{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Implementing a CNN for text classification in tensorflow\n",
    "**Guide Link**: http://www.wildml.com/2015/12/implementing-a-cnn-for-text-classification-in-tensorflow/\n",
    "\n",
    "**TODOS**: apply it to emotion classificaiton"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%load_ext autoreload\n",
    "%autoreload 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/ellfae/anaconda3/envs/tensorflow/lib/python3.6/site-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n",
      "  \"This module will be removed in 0.20.\", DeprecationWarning)\n"
     ]
    }
   ],
   "source": [
    "from helpers import *\n",
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import os\n",
    "import time\n",
    "import datetime\n",
    "from tensorflow.contrib import learn"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Data and Preprocessing"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* Load positive and negative sentences from the raw data files.\n",
    "* Clean the text data using the same code as the original paper.\n",
    "* Pad each sentence to the maximum sentence length, which turns out to be 59. We append special <PAD> tokens to all other sentences to make them 59 words. Padding sentences to the same length is useful because it allows us to efficiently batch our data since each example in a batch must be of the same length.\n",
    "* Build a vocabulary index and map each word to an integer between 0 and 18,765 (the vocabulary size). Each sentence becomes a vector of integers."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Parameters\n",
    "---"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# Parameters\n",
    "# ==================================================\n",
    "\n",
    "# Data loading params\n",
    "tf.flags.DEFINE_float(\"dev_sample_percentage\", .1, \"Percentage of the training data to use for validation\")\n",
    "tf.flags.DEFINE_string(\"positive_data_file\", \"./data/rt-polaritydata/rt-polarity.pos\", \"Data source for the positive data.\")\n",
    "tf.flags.DEFINE_string(\"negative_data_file\", \"./data/rt-polaritydata/rt-polarity.neg\", \"Data source for the negative data.\")\n",
    "\n",
    "# Model Hyperparameters\n",
    "tf.flags.DEFINE_integer(\"embedding_dim\", 128, \"Dimensionality of character embedding (default: 128)\")\n",
    "tf.flags.DEFINE_string(\"filter_sizes\", \"3,4,5\", \"Comma-separated filter sizes (default: '3,4,5')\")\n",
    "tf.flags.DEFINE_integer(\"num_filters\", 128, \"Number of filters per filter size (default: 128)\")\n",
    "\n",
    "# these are both used to add regularization; it is needed where data is small in size\n",
    "tf.flags.DEFINE_float(\"dropout_keep_prob\", 0.5, \"Dropout keep probability (default: 0.5)\")\n",
    "tf.flags.DEFINE_float(\"l2_reg_lambda\", 0.0, \"L2 regularization lambda (default: 0.0)\")\n",
    "\n",
    "# Training parameters\n",
    "tf.flags.DEFINE_integer(\"batch_size\", 64, \"Batch Size (default: 64)\")\n",
    "tf.flags.DEFINE_integer(\"num_epochs\", 200, \"Number of training epochs (default: 200)\")\n",
    "tf.flags.DEFINE_integer(\"evaluate_every\", 100, \"Evaluate model on dev set after this many steps (default: 100)\")\n",
    "tf.flags.DEFINE_integer(\"checkpoint_every\", 100, \"Save model after this many steps (default: 100)\")\n",
    "tf.flags.DEFINE_integer(\"num_checkpoints\", 5, \"Number of checkpoints to store (default: 5)\")\n",
    "# Misc Parameters\n",
    "tf.flags.DEFINE_boolean(\"allow_soft_placement\", True, \"Allow device soft device placement\")\n",
    "tf.flags.DEFINE_boolean(\"log_device_placement\", False, \"Log placement of ops on devices\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "FLAGS = tf.flags.FLAGS"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['-f',\n",
       " '/run/user/1000/jupyter/kernel-890f3a35-458f-4167-b570-107a3a2e03f1.json']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "FLAGS._parse_flags()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Parameters:\n",
      "ALLOW_SOFT_PLACEMENT=True\n",
      "BATCH_SIZE=64\n",
      "CHECKPOINT_EVERY=100\n",
      "DEV_SAMPLE_PERCENTAGE=0.1\n",
      "DROPOUT_KEEP_PROB=0.5\n",
      "EMBEDDING_DIM=128\n",
      "EVALUATE_EVERY=100\n",
      "FILTER_SIZES=3,4,5\n",
      "L2_REG_LAMBDA=0.0\n",
      "LOG_DEVICE_PLACEMENT=False\n",
      "NEGATIVE_DATA_FILE=./data/rt-polaritydata/rt-polarity.neg\n",
      "NUM_CHECKPOINTS=5\n",
      "NUM_EPOCHS=200\n",
      "NUM_FILTERS=128\n",
      "POSITIVE_DATA_FILE=./data/rt-polaritydata/rt-polarity.pos\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print (\"\\nParameters:\")\n",
    "for attr, value in sorted(FLAGS.__flags.items()):\n",
    "    print(\"{}={}\".format(attr.upper(), value))\n",
    "print(\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Data Preparation\n",
    "---"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "loading data...\n"
     ]
    }
   ],
   "source": [
    "# laod data (pos: 5331 neg: 5331)\n",
    "print(\"loading data...\")\n",
    "x_text, y = cnn_data_helpers.load_data_and_labels(FLAGS.positive_data_file, FLAGS.negative_data_file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0, 1],\n",
       "       [0, 1]])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y[:2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[\"the rock is destined to be the 21st century 's new conan and that he 's going to make a splash even greater than arnold schwarzenegger , jean claud van damme or steven segal\",\n",
       " \"the gorgeously elaborate continuation of the lord of the rings trilogy is so huge that a column of words cannot adequately describe co writer director peter jackson 's expanded vision of j r r tolkien 's middle earth\",\n",
       " 'effective but too tepid biopic',\n",
       " 'if you sometimes like to go to the movies to have fun , wasabi is a good place to start',\n",
       " \"emerges as something rare , an issue movie that 's so honest and keenly observed that it does n't feel like one\",\n",
       " 'the film provides some great insight into the neurotic mindset of all comics even those who have reached the absolute top of the game',\n",
       " 'offers that rare combination of entertainment and education',\n",
       " 'perhaps no picture ever made has more literally showed that the road to hell is paved with good intentions',\n",
       " \"steers turns in a snappy screenplay that curls at the edges it 's so clever you want to hate it but he somehow pulls it off\",\n",
       " 'take care of my cat offers a refreshingly different slice of asian cinema']"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_text[:10]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Building vocbulary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Build vocabulary\n",
    "max_document_length = max([len(x.split(\" \")) for x in x_text])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "vocab_processor = learn.preprocessing.VocabularyProcessor(max_document_length)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "x = np.array(list(vocab_processor.fit_transform(x_text)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10662, 56)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Randomly shuffle data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Randomly shuffle data\n",
    "np.random.seed(10)\n",
    "shuffle_indices = np.random.permutation(np.arange(len(y)))\n",
    "x_shuffled = x[shuffle_indices]\n",
    "y_shuffled = y[shuffle_indices]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Split train/test set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "dev_sample_index = -1 * int(FLAGS.dev_sample_percentage * float(len(y)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-1066"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dev_sample_index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x_train, x_dev = x_shuffled[:dev_sample_index], x_shuffled[dev_sample_index:]\n",
    "y_train, y_dev = y_shuffled[:dev_sample_index], y_shuffled[dev_sample_index:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Vocabulary Size: 18758\n",
      "Train/Dev split: 9596/1066\n"
     ]
    }
   ],
   "source": [
    "print(\"Vocabulary Size: {:d}\".format(len(vocab_processor.vocabulary_)))\n",
    "print(\"Train/Dev split: {:d}/{:d}\".format(len(y_train), len(y_dev)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Training\n",
    "---"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name embedding/W:0/grad/hist is illegal; using embedding/W_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,185 : INFO : Summary name embedding/W:0/grad/hist is illegal; using embedding/W_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name embedding/W:0/grad/sparsity is illegal; using embedding/W_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,199 : INFO : Summary name embedding/W:0/grad/sparsity is illegal; using embedding/W_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-3/W:0/grad/hist is illegal; using conv-maxpool-3/W_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,202 : INFO : Summary name conv-maxpool-3/W:0/grad/hist is illegal; using conv-maxpool-3/W_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-3/W:0/grad/sparsity is illegal; using conv-maxpool-3/W_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,208 : INFO : Summary name conv-maxpool-3/W:0/grad/sparsity is illegal; using conv-maxpool-3/W_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-3/b:0/grad/hist is illegal; using conv-maxpool-3/b_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,214 : INFO : Summary name conv-maxpool-3/b:0/grad/hist is illegal; using conv-maxpool-3/b_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-3/b:0/grad/sparsity is illegal; using conv-maxpool-3/b_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,219 : INFO : Summary name conv-maxpool-3/b:0/grad/sparsity is illegal; using conv-maxpool-3/b_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-4/W:0/grad/hist is illegal; using conv-maxpool-4/W_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,223 : INFO : Summary name conv-maxpool-4/W:0/grad/hist is illegal; using conv-maxpool-4/W_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-4/W:0/grad/sparsity is illegal; using conv-maxpool-4/W_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,228 : INFO : Summary name conv-maxpool-4/W:0/grad/sparsity is illegal; using conv-maxpool-4/W_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-4/b:0/grad/hist is illegal; using conv-maxpool-4/b_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,231 : INFO : Summary name conv-maxpool-4/b:0/grad/hist is illegal; using conv-maxpool-4/b_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-4/b:0/grad/sparsity is illegal; using conv-maxpool-4/b_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,236 : INFO : Summary name conv-maxpool-4/b:0/grad/sparsity is illegal; using conv-maxpool-4/b_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-5/W:0/grad/hist is illegal; using conv-maxpool-5/W_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,240 : INFO : Summary name conv-maxpool-5/W:0/grad/hist is illegal; using conv-maxpool-5/W_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-5/W:0/grad/sparsity is illegal; using conv-maxpool-5/W_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,250 : INFO : Summary name conv-maxpool-5/W:0/grad/sparsity is illegal; using conv-maxpool-5/W_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-5/b:0/grad/hist is illegal; using conv-maxpool-5/b_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,254 : INFO : Summary name conv-maxpool-5/b:0/grad/hist is illegal; using conv-maxpool-5/b_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name conv-maxpool-5/b:0/grad/sparsity is illegal; using conv-maxpool-5/b_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,263 : INFO : Summary name conv-maxpool-5/b:0/grad/sparsity is illegal; using conv-maxpool-5/b_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name W:0/grad/hist is illegal; using W_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,266 : INFO : Summary name W:0/grad/hist is illegal; using W_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name W:0/grad/sparsity is illegal; using W_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,275 : INFO : Summary name W:0/grad/sparsity is illegal; using W_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name output/b:0/grad/hist is illegal; using output/b_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,277 : INFO : Summary name output/b:0/grad/hist is illegal; using output/b_0/grad/hist instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Summary name output/b:0/grad/sparsity is illegal; using output/b_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2017-11-04 19:04:07,284 : INFO : Summary name output/b:0/grad/sparsity is illegal; using output/b_0/grad/sparsity instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447\n",
      "\n",
      "2017-11-04T19:04:08.013092: step 1, loss 4.70679, acc 0.515625\n",
      "2017-11-04T19:04:08.288562: step 2, loss 3.33291, acc 0.46875\n",
      "2017-11-04T19:04:08.569549: step 3, loss 2.30769, acc 0.59375\n",
      "2017-11-04T19:04:08.837223: step 4, loss 1.86117, acc 0.5\n",
      "2017-11-04T19:04:09.192384: step 5, loss 1.93099, acc 0.5625\n",
      "2017-11-04T19:04:09.481266: step 6, loss 2.00088, acc 0.5625\n",
      "2017-11-04T19:04:09.740068: step 7, loss 2.60071, acc 0.5\n",
      "2017-11-04T19:04:09.993488: step 8, loss 2.55949, acc 0.515625\n",
      "2017-11-04T19:04:10.258245: step 9, loss 2.03948, acc 0.578125\n",
      "2017-11-04T19:04:10.588383: step 10, loss 2.13896, acc 0.515625\n",
      "2017-11-04T19:04:10.954006: step 11, loss 2.67815, acc 0.40625\n",
      "2017-11-04T19:04:11.304037: step 12, loss 2.1461, acc 0.578125\n",
      "2017-11-04T19:04:11.761245: step 13, loss 2.1862, acc 0.515625\n",
      "2017-11-04T19:04:12.055089: step 14, loss 1.62741, acc 0.515625\n",
      "2017-11-04T19:04:12.389285: step 15, loss 1.94699, acc 0.53125\n",
      "2017-11-04T19:04:12.693298: step 16, loss 2.18664, acc 0.515625\n",
      "2017-11-04T19:04:13.041035: step 17, loss 1.87828, acc 0.484375\n",
      "2017-11-04T19:04:13.351198: step 18, loss 2.17266, acc 0.421875\n",
      "2017-11-04T19:04:13.634068: step 19, loss 2.06748, acc 0.5\n",
      "2017-11-04T19:04:13.899560: step 20, loss 2.15404, acc 0.484375\n",
      "2017-11-04T19:04:14.254083: step 21, loss 1.9412, acc 0.46875\n",
      "2017-11-04T19:04:14.561451: step 22, loss 1.67168, acc 0.5625\n",
      "2017-11-04T19:04:14.832501: step 23, loss 1.69942, acc 0.546875\n",
      "2017-11-04T19:04:15.096222: step 24, loss 1.98613, acc 0.5\n",
      "2017-11-04T19:04:15.332107: step 25, loss 2.08565, acc 0.484375\n",
      "2017-11-04T19:04:15.614212: step 26, loss 1.41941, acc 0.53125\n",
      "2017-11-04T19:04:16.035558: step 27, loss 2.11074, acc 0.40625\n",
      "2017-11-04T19:04:16.317011: step 28, loss 1.59962, acc 0.46875\n",
      "2017-11-04T19:04:16.607195: step 29, loss 1.97107, acc 0.421875\n",
      "2017-11-04T19:04:16.862833: step 30, loss 1.82719, acc 0.5\n",
      "2017-11-04T19:04:17.156925: step 31, loss 1.7343, acc 0.59375\n",
      "2017-11-04T19:04:17.518210: step 32, loss 1.93423, acc 0.5\n",
      "2017-11-04T19:04:17.804083: step 33, loss 1.95228, acc 0.578125\n",
      "2017-11-04T19:04:18.051134: step 34, loss 1.50069, acc 0.5\n",
      "2017-11-04T19:04:18.332081: step 35, loss 2.53155, acc 0.40625\n",
      "2017-11-04T19:04:18.588279: step 36, loss 1.88813, acc 0.453125\n",
      "2017-11-04T19:04:18.893812: step 37, loss 2.04119, acc 0.421875\n",
      "2017-11-04T19:04:19.125973: step 38, loss 2.18589, acc 0.484375\n",
      "2017-11-04T19:04:19.368831: step 39, loss 1.88536, acc 0.5\n",
      "2017-11-04T19:04:19.617071: step 40, loss 1.52256, acc 0.5625\n",
      "2017-11-04T19:04:19.915446: step 41, loss 2.11639, acc 0.515625\n",
      "2017-11-04T19:04:20.177009: step 42, loss 2.4512, acc 0.484375\n",
      "2017-11-04T19:04:20.452165: step 43, loss 2.2557, acc 0.546875\n",
      "2017-11-04T19:04:20.718779: step 44, loss 1.87067, acc 0.546875\n",
      "2017-11-04T19:04:21.053543: step 45, loss 1.59084, acc 0.578125\n",
      "2017-11-04T19:04:21.354389: step 46, loss 1.50908, acc 0.546875\n",
      "2017-11-04T19:04:21.598003: step 47, loss 2.23568, acc 0.4375\n",
      "2017-11-04T19:04:21.890396: step 48, loss 1.72486, acc 0.453125\n",
      "2017-11-04T19:04:22.176077: step 49, loss 1.64792, acc 0.578125\n",
      "2017-11-04T19:04:22.542127: step 50, loss 1.40462, acc 0.578125\n",
      "2017-11-04T19:04:22.802533: step 51, loss 1.5031, acc 0.59375\n",
      "2017-11-04T19:04:23.070577: step 52, loss 1.85714, acc 0.515625\n",
      "2017-11-04T19:04:23.514176: step 53, loss 1.6191, acc 0.5625\n",
      "2017-11-04T19:04:23.794352: step 54, loss 1.61505, acc 0.484375\n",
      "2017-11-04T19:04:24.075817: step 55, loss 1.47533, acc 0.515625\n",
      "2017-11-04T19:04:24.316463: step 56, loss 1.61591, acc 0.484375\n",
      "2017-11-04T19:04:24.565503: step 57, loss 1.63461, acc 0.53125\n",
      "2017-11-04T19:04:24.826780: step 58, loss 1.65925, acc 0.515625\n",
      "2017-11-04T19:04:25.078837: step 59, loss 2.05979, acc 0.5625\n",
      "2017-11-04T19:04:25.457614: step 60, loss 1.45085, acc 0.546875\n",
      "2017-11-04T19:04:25.726159: step 61, loss 1.68085, acc 0.515625\n",
      "2017-11-04T19:04:25.968653: step 62, loss 1.95228, acc 0.484375\n",
      "2017-11-04T19:04:26.210869: step 63, loss 1.31728, acc 0.578125\n",
      "2017-11-04T19:04:26.422481: step 64, loss 1.3663, acc 0.5\n",
      "2017-11-04T19:04:26.683611: step 65, loss 1.48564, acc 0.625\n",
      "2017-11-04T19:04:27.074345: step 66, loss 1.70757, acc 0.5\n",
      "2017-11-04T19:04:27.408918: step 67, loss 1.99, acc 0.453125\n",
      "2017-11-04T19:04:27.625599: step 68, loss 1.41795, acc 0.59375\n",
      "2017-11-04T19:04:28.058361: step 69, loss 1.52529, acc 0.609375\n",
      "2017-11-04T19:04:28.354580: step 70, loss 1.04105, acc 0.6875\n",
      "2017-11-04T19:04:28.634973: step 71, loss 1.3757, acc 0.59375\n",
      "2017-11-04T19:04:28.892366: step 72, loss 1.54684, acc 0.53125\n",
      "2017-11-04T19:04:29.183609: step 73, loss 1.69063, acc 0.546875\n",
      "2017-11-04T19:04:29.453531: step 74, loss 2.10839, acc 0.46875\n",
      "2017-11-04T19:04:29.719307: step 75, loss 2.33692, acc 0.5\n",
      "2017-11-04T19:04:30.015567: step 76, loss 1.62837, acc 0.46875\n",
      "2017-11-04T19:04:30.268378: step 77, loss 1.11588, acc 0.625\n",
      "2017-11-04T19:04:30.504692: step 78, loss 1.50838, acc 0.5\n",
      "2017-11-04T19:04:30.757524: step 79, loss 1.20733, acc 0.59375\n",
      "2017-11-04T19:04:31.040927: step 80, loss 1.33358, acc 0.53125\n",
      "2017-11-04T19:04:31.333315: step 81, loss 2.1122, acc 0.390625\n",
      "2017-11-04T19:04:31.617322: step 82, loss 1.48618, acc 0.59375\n",
      "2017-11-04T19:04:31.939115: step 83, loss 1.43319, acc 0.578125\n",
      "2017-11-04T19:04:32.197060: step 84, loss 1.70217, acc 0.53125\n",
      "2017-11-04T19:04:32.464811: step 85, loss 1.55347, acc 0.578125\n",
      "2017-11-04T19:04:32.741923: step 86, loss 1.64319, acc 0.5\n",
      "2017-11-04T19:04:33.091054: step 87, loss 1.99802, acc 0.453125\n",
      "2017-11-04T19:04:33.349637: step 88, loss 1.4503, acc 0.5625\n",
      "2017-11-04T19:04:33.587615: step 89, loss 1.53072, acc 0.578125\n",
      "2017-11-04T19:04:33.848923: step 90, loss 1.38064, acc 0.625\n",
      "2017-11-04T19:04:34.107767: step 91, loss 1.48387, acc 0.53125\n",
      "2017-11-04T19:04:34.380717: step 92, loss 1.21946, acc 0.546875\n",
      "2017-11-04T19:04:34.646828: step 93, loss 1.24261, acc 0.59375\n",
      "2017-11-04T19:04:34.919486: step 94, loss 1.7829, acc 0.453125\n",
      "2017-11-04T19:04:35.306874: step 95, loss 1.60206, acc 0.546875\n",
      "2017-11-04T19:04:35.639041: step 96, loss 1.65334, acc 0.546875\n",
      "2017-11-04T19:04:36.047692: step 97, loss 1.87107, acc 0.484375\n",
      "2017-11-04T19:04:36.436337: step 98, loss 1.68333, acc 0.5\n",
      "2017-11-04T19:04:36.765099: step 99, loss 1.78326, acc 0.484375\n",
      "2017-11-04T19:04:37.063538: step 100, loss 1.72046, acc 0.515625\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:04:38.237454: step 100, loss 0.837146, acc 0.570356\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-100\n",
      "\n",
      "2017-11-04T19:04:38.749107: step 101, loss 1.19249, acc 0.703125\n",
      "2017-11-04T19:04:39.130184: step 102, loss 1.61293, acc 0.5625\n",
      "2017-11-04T19:04:39.481720: step 103, loss 1.67329, acc 0.59375\n",
      "2017-11-04T19:04:39.778459: step 104, loss 2.01251, acc 0.53125\n",
      "2017-11-04T19:04:40.085399: step 105, loss 1.90149, acc 0.421875\n",
      "2017-11-04T19:04:40.435671: step 106, loss 1.32985, acc 0.640625\n",
      "2017-11-04T19:04:40.763872: step 107, loss 1.71218, acc 0.484375\n",
      "2017-11-04T19:04:41.140892: step 108, loss 1.46333, acc 0.46875\n",
      "2017-11-04T19:04:41.424420: step 109, loss 1.33786, acc 0.546875\n",
      "2017-11-04T19:04:41.743601: step 110, loss 1.0586, acc 0.625\n",
      "2017-11-04T19:04:42.096297: step 111, loss 1.4381, acc 0.484375\n",
      "2017-11-04T19:04:42.470528: step 112, loss 1.42597, acc 0.578125\n",
      "2017-11-04T19:04:42.857488: step 113, loss 1.55359, acc 0.515625\n",
      "2017-11-04T19:04:43.161843: step 114, loss 1.14615, acc 0.59375\n",
      "2017-11-04T19:04:43.518468: step 115, loss 2.07606, acc 0.484375\n",
      "2017-11-04T19:04:43.813297: step 116, loss 1.48868, acc 0.515625\n",
      "2017-11-04T19:04:44.216596: step 117, loss 1.5319, acc 0.484375\n",
      "2017-11-04T19:04:44.599680: step 118, loss 1.9401, acc 0.515625\n",
      "2017-11-04T19:04:44.953937: step 119, loss 1.61494, acc 0.546875\n",
      "2017-11-04T19:04:45.553908: step 120, loss 1.49755, acc 0.515625\n",
      "2017-11-04T19:04:46.026067: step 121, loss 1.50797, acc 0.59375\n",
      "2017-11-04T19:04:46.470050: step 122, loss 2.13102, acc 0.40625\n",
      "2017-11-04T19:04:46.842709: step 123, loss 1.26205, acc 0.59375\n",
      "2017-11-04T19:04:47.224589: step 124, loss 1.6749, acc 0.5\n",
      "2017-11-04T19:04:47.560378: step 125, loss 1.21501, acc 0.5625\n",
      "2017-11-04T19:04:47.917651: step 126, loss 1.29007, acc 0.5\n",
      "2017-11-04T19:04:48.176737: step 127, loss 1.47236, acc 0.5625\n",
      "2017-11-04T19:04:48.494380: step 128, loss 1.31495, acc 0.609375\n",
      "2017-11-04T19:04:48.796153: step 129, loss 1.18508, acc 0.625\n",
      "2017-11-04T19:04:49.069544: step 130, loss 1.60774, acc 0.578125\n",
      "2017-11-04T19:04:49.345432: step 131, loss 1.88397, acc 0.5\n",
      "2017-11-04T19:04:49.593750: step 132, loss 2.09819, acc 0.421875\n",
      "2017-11-04T19:04:49.906603: step 133, loss 1.79695, acc 0.515625\n",
      "2017-11-04T19:04:50.183327: step 134, loss 1.83541, acc 0.40625\n",
      "2017-11-04T19:04:50.444430: step 135, loss 1.13114, acc 0.59375\n",
      "2017-11-04T19:04:50.812606: step 136, loss 1.14835, acc 0.625\n",
      "2017-11-04T19:04:51.070798: step 137, loss 1.65472, acc 0.46875\n",
      "2017-11-04T19:04:51.340608: step 138, loss 1.35763, acc 0.5625\n",
      "2017-11-04T19:04:51.630079: step 139, loss 1.51085, acc 0.546875\n",
      "2017-11-04T19:04:51.862230: step 140, loss 1.46769, acc 0.484375\n",
      "2017-11-04T19:04:52.169789: step 141, loss 1.54741, acc 0.5625\n",
      "2017-11-04T19:04:52.501682: step 142, loss 1.33665, acc 0.5\n",
      "2017-11-04T19:04:52.808916: step 143, loss 0.952549, acc 0.546875\n",
      "2017-11-04T19:04:53.063097: step 144, loss 1.22756, acc 0.625\n",
      "2017-11-04T19:04:53.397226: step 145, loss 1.70122, acc 0.421875\n",
      "2017-11-04T19:04:53.695378: step 146, loss 1.03868, acc 0.625\n",
      "2017-11-04T19:04:53.936939: step 147, loss 1.18798, acc 0.625\n",
      "2017-11-04T19:04:54.222550: step 148, loss 1.58773, acc 0.546875\n",
      "2017-11-04T19:04:54.560922: step 149, loss 1.2973, acc 0.5625\n",
      "2017-11-04T19:04:54.834528: step 150, loss 1.45694, acc 0.583333\n",
      "2017-11-04T19:04:55.129905: step 151, loss 0.938501, acc 0.609375\n",
      "2017-11-04T19:04:55.369014: step 152, loss 1.18431, acc 0.5625\n",
      "2017-11-04T19:04:55.682681: step 153, loss 1.33719, acc 0.609375\n",
      "2017-11-04T19:04:55.990051: step 154, loss 1.0626, acc 0.625\n",
      "2017-11-04T19:04:56.275909: step 155, loss 1.11292, acc 0.625\n",
      "2017-11-04T19:04:56.519500: step 156, loss 0.855762, acc 0.6875\n",
      "2017-11-04T19:04:56.780626: step 157, loss 1.26344, acc 0.5625\n",
      "2017-11-04T19:04:57.066482: step 158, loss 1.25062, acc 0.625\n",
      "2017-11-04T19:04:57.336295: step 159, loss 1.47185, acc 0.546875\n",
      "2017-11-04T19:04:57.595247: step 160, loss 1.32097, acc 0.515625\n",
      "2017-11-04T19:04:57.887645: step 161, loss 0.953912, acc 0.65625\n",
      "2017-11-04T19:04:58.237918: step 162, loss 0.717483, acc 0.75\n",
      "2017-11-04T19:04:58.496514: step 163, loss 1.57431, acc 0.484375\n",
      "2017-11-04T19:04:58.754490: step 164, loss 1.407, acc 0.53125\n",
      "2017-11-04T19:04:59.024922: step 165, loss 1.13222, acc 0.59375\n",
      "2017-11-04T19:04:59.280261: step 166, loss 1.26084, acc 0.59375\n",
      "2017-11-04T19:04:59.616927: step 167, loss 1.00668, acc 0.65625\n",
      "2017-11-04T19:04:59.927605: step 168, loss 0.652354, acc 0.71875\n",
      "2017-11-04T19:05:00.179499: step 169, loss 1.06057, acc 0.625\n",
      "2017-11-04T19:05:00.411346: step 170, loss 1.00805, acc 0.609375\n",
      "2017-11-04T19:05:00.770270: step 171, loss 1.0239, acc 0.609375\n",
      "2017-11-04T19:05:01.029177: step 172, loss 0.830644, acc 0.65625\n",
      "2017-11-04T19:05:01.343522: step 173, loss 1.08048, acc 0.515625\n",
      "2017-11-04T19:05:01.581123: step 174, loss 1.23505, acc 0.53125\n",
      "2017-11-04T19:05:01.858925: step 175, loss 1.29328, acc 0.5625\n",
      "2017-11-04T19:05:02.151797: step 176, loss 0.787963, acc 0.703125\n",
      "2017-11-04T19:05:02.458923: step 177, loss 1.16742, acc 0.5625\n",
      "2017-11-04T19:05:02.735471: step 178, loss 0.874538, acc 0.671875\n",
      "2017-11-04T19:05:03.023459: step 179, loss 0.835919, acc 0.671875\n",
      "2017-11-04T19:05:03.333295: step 180, loss 1.19784, acc 0.5625\n",
      "2017-11-04T19:05:03.666548: step 181, loss 1.10065, acc 0.609375\n",
      "2017-11-04T19:05:04.004151: step 182, loss 0.989747, acc 0.609375\n",
      "2017-11-04T19:05:04.346162: step 183, loss 1.06755, acc 0.59375\n",
      "2017-11-04T19:05:04.596947: step 184, loss 1.3972, acc 0.53125\n",
      "2017-11-04T19:05:04.901726: step 185, loss 1.37008, acc 0.5\n",
      "2017-11-04T19:05:05.155481: step 186, loss 0.774424, acc 0.640625\n",
      "2017-11-04T19:05:05.447538: step 187, loss 1.31415, acc 0.5625\n",
      "2017-11-04T19:05:05.727854: step 188, loss 0.946663, acc 0.640625\n",
      "2017-11-04T19:05:06.058304: step 189, loss 0.98055, acc 0.640625\n",
      "2017-11-04T19:05:06.307254: step 190, loss 1.19482, acc 0.640625\n",
      "2017-11-04T19:05:06.607320: step 191, loss 0.951549, acc 0.6875\n",
      "2017-11-04T19:05:06.874824: step 192, loss 1.08859, acc 0.609375\n",
      "2017-11-04T19:05:07.116372: step 193, loss 0.941666, acc 0.65625\n",
      "2017-11-04T19:05:07.371968: step 194, loss 0.908867, acc 0.640625\n",
      "2017-11-04T19:05:07.610856: step 195, loss 1.41209, acc 0.546875\n",
      "2017-11-04T19:05:07.894624: step 196, loss 0.87202, acc 0.640625\n",
      "2017-11-04T19:05:08.146295: step 197, loss 0.8696, acc 0.671875\n",
      "2017-11-04T19:05:08.412579: step 198, loss 0.878894, acc 0.671875\n",
      "2017-11-04T19:05:08.658170: step 199, loss 1.26624, acc 0.484375\n",
      "2017-11-04T19:05:08.972915: step 200, loss 0.824976, acc 0.71875\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:05:09.873475: step 200, loss 0.687149, acc 0.605066\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-200\n",
      "\n",
      "2017-11-04T19:05:10.290616: step 201, loss 0.889673, acc 0.578125\n",
      "2017-11-04T19:05:10.554580: step 202, loss 0.810976, acc 0.6875\n",
      "2017-11-04T19:05:10.890023: step 203, loss 0.988913, acc 0.671875\n",
      "2017-11-04T19:05:11.164855: step 204, loss 0.855369, acc 0.578125\n",
      "2017-11-04T19:05:11.429695: step 205, loss 1.1085, acc 0.515625\n",
      "2017-11-04T19:05:11.729356: step 206, loss 0.731028, acc 0.71875\n",
      "2017-11-04T19:05:11.965359: step 207, loss 1.41788, acc 0.421875\n",
      "2017-11-04T19:05:12.239730: step 208, loss 0.774793, acc 0.609375\n",
      "2017-11-04T19:05:12.534328: step 209, loss 0.832143, acc 0.65625\n",
      "2017-11-04T19:05:12.817146: step 210, loss 1.1578, acc 0.5\n",
      "2017-11-04T19:05:13.103402: step 211, loss 1.24532, acc 0.5625\n",
      "2017-11-04T19:05:13.360923: step 212, loss 1.26804, acc 0.578125\n",
      "2017-11-04T19:05:13.635953: step 213, loss 1.17744, acc 0.546875\n",
      "2017-11-04T19:05:13.885369: step 214, loss 0.894525, acc 0.6875\n",
      "2017-11-04T19:05:14.195755: step 215, loss 1.1462, acc 0.5625\n",
      "2017-11-04T19:05:14.549573: step 216, loss 1.01872, acc 0.625\n",
      "2017-11-04T19:05:14.860912: step 217, loss 1.00058, acc 0.609375\n",
      "2017-11-04T19:05:15.104486: step 218, loss 1.08393, acc 0.546875\n",
      "2017-11-04T19:05:15.440072: step 219, loss 1.03516, acc 0.578125\n",
      "2017-11-04T19:05:15.816195: step 220, loss 0.887706, acc 0.59375\n",
      "2017-11-04T19:05:16.176313: step 221, loss 0.811152, acc 0.671875\n",
      "2017-11-04T19:05:16.551679: step 222, loss 1.01663, acc 0.625\n",
      "2017-11-04T19:05:16.936126: step 223, loss 1.29086, acc 0.53125\n",
      "2017-11-04T19:05:17.317006: step 224, loss 0.882409, acc 0.609375\n",
      "2017-11-04T19:05:17.674655: step 225, loss 1.45102, acc 0.5\n",
      "2017-11-04T19:05:17.990754: step 226, loss 1.0584, acc 0.609375\n",
      "2017-11-04T19:05:18.267859: step 227, loss 0.862667, acc 0.640625\n",
      "2017-11-04T19:05:18.581595: step 228, loss 0.709418, acc 0.640625\n",
      "2017-11-04T19:05:18.914039: step 229, loss 0.935584, acc 0.59375\n",
      "2017-11-04T19:05:19.299782: step 230, loss 1.00473, acc 0.609375\n",
      "2017-11-04T19:05:19.655367: step 231, loss 1.19612, acc 0.609375\n",
      "2017-11-04T19:05:19.948785: step 232, loss 1.08275, acc 0.53125\n",
      "2017-11-04T19:05:20.250698: step 233, loss 1.01009, acc 0.671875\n",
      "2017-11-04T19:05:20.503874: step 234, loss 0.875449, acc 0.734375\n",
      "2017-11-04T19:05:20.845219: step 235, loss 1.22351, acc 0.609375\n",
      "2017-11-04T19:05:21.151665: step 236, loss 0.977386, acc 0.53125\n",
      "2017-11-04T19:05:21.418057: step 237, loss 0.917967, acc 0.640625\n",
      "2017-11-04T19:05:21.633438: step 238, loss 0.703187, acc 0.65625\n",
      "2017-11-04T19:05:21.916859: step 239, loss 0.900511, acc 0.609375\n",
      "2017-11-04T19:05:22.209895: step 240, loss 0.946675, acc 0.6875\n",
      "2017-11-04T19:05:22.445266: step 241, loss 1.3334, acc 0.546875\n",
      "2017-11-04T19:05:22.699155: step 242, loss 1.15424, acc 0.5625\n",
      "2017-11-04T19:05:23.014380: step 243, loss 0.886131, acc 0.59375\n",
      "2017-11-04T19:05:23.331107: step 244, loss 1.0624, acc 0.578125\n",
      "2017-11-04T19:05:23.689724: step 245, loss 0.71696, acc 0.6875\n",
      "2017-11-04T19:05:24.006586: step 246, loss 0.778563, acc 0.625\n",
      "2017-11-04T19:05:24.318013: step 247, loss 1.01185, acc 0.625\n",
      "2017-11-04T19:05:24.566681: step 248, loss 1.27446, acc 0.5625\n",
      "2017-11-04T19:05:24.858199: step 249, loss 1.06483, acc 0.5625\n",
      "2017-11-04T19:05:25.153843: step 250, loss 0.754905, acc 0.609375\n",
      "2017-11-04T19:05:25.492882: step 251, loss 0.907166, acc 0.59375\n",
      "2017-11-04T19:05:25.727329: step 252, loss 1.0272, acc 0.5625\n",
      "2017-11-04T19:05:25.951934: step 253, loss 0.969565, acc 0.609375\n",
      "2017-11-04T19:05:26.233768: step 254, loss 0.960513, acc 0.5625\n",
      "2017-11-04T19:05:26.476425: step 255, loss 1.04843, acc 0.578125\n",
      "2017-11-04T19:05:26.720450: step 256, loss 0.961025, acc 0.625\n",
      "2017-11-04T19:05:26.988463: step 257, loss 0.849209, acc 0.578125\n",
      "2017-11-04T19:05:27.258397: step 258, loss 0.701156, acc 0.671875\n",
      "2017-11-04T19:05:27.559837: step 259, loss 1.09251, acc 0.515625\n",
      "2017-11-04T19:05:27.844080: step 260, loss 0.981537, acc 0.609375\n",
      "2017-11-04T19:05:28.176927: step 261, loss 1.01934, acc 0.640625\n",
      "2017-11-04T19:05:28.484823: step 262, loss 1.01277, acc 0.5625\n",
      "2017-11-04T19:05:28.832084: step 263, loss 0.799568, acc 0.65625\n",
      "2017-11-04T19:05:29.206047: step 264, loss 0.728066, acc 0.671875\n",
      "2017-11-04T19:05:29.576939: step 265, loss 1.07889, acc 0.609375\n",
      "2017-11-04T19:05:29.873453: step 266, loss 0.736996, acc 0.640625\n",
      "2017-11-04T19:05:30.126358: step 267, loss 1.01499, acc 0.484375\n",
      "2017-11-04T19:05:30.463068: step 268, loss 0.724616, acc 0.71875\n",
      "2017-11-04T19:05:30.784925: step 269, loss 0.882049, acc 0.625\n",
      "2017-11-04T19:05:31.144310: step 270, loss 0.731732, acc 0.703125\n",
      "2017-11-04T19:05:31.465357: step 271, loss 0.853111, acc 0.609375\n",
      "2017-11-04T19:05:31.940936: step 272, loss 0.816347, acc 0.625\n",
      "2017-11-04T19:05:32.227709: step 273, loss 1.08735, acc 0.578125\n",
      "2017-11-04T19:05:32.546560: step 274, loss 0.546313, acc 0.75\n",
      "2017-11-04T19:05:32.863550: step 275, loss 0.848793, acc 0.578125\n",
      "2017-11-04T19:05:33.191872: step 276, loss 0.900458, acc 0.65625\n",
      "2017-11-04T19:05:33.510277: step 277, loss 1.01456, acc 0.59375\n",
      "2017-11-04T19:05:33.848772: step 278, loss 0.658442, acc 0.6875\n",
      "2017-11-04T19:05:34.197064: step 279, loss 0.901254, acc 0.578125\n",
      "2017-11-04T19:05:34.507643: step 280, loss 0.723136, acc 0.71875\n",
      "2017-11-04T19:05:34.761170: step 281, loss 0.721305, acc 0.625\n",
      "2017-11-04T19:05:35.064908: step 282, loss 0.626993, acc 0.6875\n",
      "2017-11-04T19:05:35.322579: step 283, loss 0.850289, acc 0.59375\n",
      "2017-11-04T19:05:35.549219: step 284, loss 1.09194, acc 0.515625\n",
      "2017-11-04T19:05:35.835638: step 285, loss 0.976627, acc 0.609375\n",
      "2017-11-04T19:05:36.137644: step 286, loss 0.946339, acc 0.671875\n",
      "2017-11-04T19:05:36.427908: step 287, loss 1.06334, acc 0.515625\n",
      "2017-11-04T19:05:36.712048: step 288, loss 0.763292, acc 0.671875\n",
      "2017-11-04T19:05:36.936984: step 289, loss 0.754505, acc 0.625\n",
      "2017-11-04T19:05:37.272657: step 290, loss 0.694639, acc 0.703125\n",
      "2017-11-04T19:05:37.590529: step 291, loss 0.64336, acc 0.703125\n",
      "2017-11-04T19:05:37.908918: step 292, loss 1.15747, acc 0.546875\n",
      "2017-11-04T19:05:38.316922: step 293, loss 0.721347, acc 0.703125\n",
      "2017-11-04T19:05:38.600454: step 294, loss 0.979959, acc 0.609375\n",
      "2017-11-04T19:05:38.871922: step 295, loss 0.715707, acc 0.640625\n",
      "2017-11-04T19:05:39.185829: step 296, loss 0.905059, acc 0.609375\n",
      "2017-11-04T19:05:39.441730: step 297, loss 0.994042, acc 0.53125\n",
      "2017-11-04T19:05:39.761482: step 298, loss 0.897532, acc 0.578125\n",
      "2017-11-04T19:05:40.028292: step 299, loss 1.08388, acc 0.515625\n",
      "2017-11-04T19:05:40.292739: step 300, loss 0.777598, acc 0.65\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:05:41.093589: step 300, loss 0.646221, acc 0.636961\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-300\n",
      "\n",
      "2017-11-04T19:05:41.494169: step 301, loss 0.704914, acc 0.71875\n",
      "2017-11-04T19:05:41.757596: step 302, loss 1.03263, acc 0.5625\n",
      "2017-11-04T19:05:42.011813: step 303, loss 0.924215, acc 0.625\n",
      "2017-11-04T19:05:42.264494: step 304, loss 0.715324, acc 0.671875\n",
      "2017-11-04T19:05:42.511668: step 305, loss 0.898281, acc 0.546875\n",
      "2017-11-04T19:05:42.786260: step 306, loss 0.683204, acc 0.65625\n",
      "2017-11-04T19:05:43.033354: step 307, loss 0.529443, acc 0.75\n",
      "2017-11-04T19:05:43.266740: step 308, loss 0.672745, acc 0.703125\n",
      "2017-11-04T19:05:43.524609: step 309, loss 0.552306, acc 0.6875\n",
      "2017-11-04T19:05:43.762848: step 310, loss 0.899743, acc 0.546875\n",
      "2017-11-04T19:05:44.060911: step 311, loss 0.857312, acc 0.65625\n",
      "2017-11-04T19:05:44.336920: step 312, loss 0.786514, acc 0.578125\n",
      "2017-11-04T19:05:44.621913: step 313, loss 0.814665, acc 0.625\n",
      "2017-11-04T19:05:44.963013: step 314, loss 0.840688, acc 0.59375\n",
      "2017-11-04T19:05:45.231451: step 315, loss 0.539287, acc 0.8125\n",
      "2017-11-04T19:05:45.551700: step 316, loss 0.948613, acc 0.609375\n",
      "2017-11-04T19:05:45.856686: step 317, loss 0.597817, acc 0.6875\n",
      "2017-11-04T19:05:46.128341: step 318, loss 0.668891, acc 0.6875\n",
      "2017-11-04T19:05:46.416588: step 319, loss 1.04021, acc 0.53125\n",
      "2017-11-04T19:05:46.804305: step 320, loss 0.618334, acc 0.703125\n",
      "2017-11-04T19:05:47.213691: step 321, loss 0.844104, acc 0.625\n",
      "2017-11-04T19:05:47.524968: step 322, loss 0.760791, acc 0.6875\n",
      "2017-11-04T19:05:47.942594: step 323, loss 0.728445, acc 0.5625\n",
      "2017-11-04T19:05:48.397266: step 324, loss 0.589499, acc 0.6875\n",
      "2017-11-04T19:05:48.740932: step 325, loss 0.868351, acc 0.625\n",
      "2017-11-04T19:05:49.069937: step 326, loss 0.809136, acc 0.640625\n",
      "2017-11-04T19:05:49.441123: step 327, loss 0.891068, acc 0.59375\n",
      "2017-11-04T19:05:49.738738: step 328, loss 0.765696, acc 0.671875\n",
      "2017-11-04T19:05:50.046762: step 329, loss 0.717793, acc 0.59375\n",
      "2017-11-04T19:05:50.296936: step 330, loss 0.535846, acc 0.703125\n",
      "2017-11-04T19:05:50.596911: step 331, loss 0.945764, acc 0.671875\n",
      "2017-11-04T19:05:50.882166: step 332, loss 0.934226, acc 0.640625\n",
      "2017-11-04T19:05:51.206430: step 333, loss 0.800179, acc 0.640625\n",
      "2017-11-04T19:05:51.527168: step 334, loss 0.658244, acc 0.671875\n",
      "2017-11-04T19:05:51.860635: step 335, loss 0.682544, acc 0.6875\n",
      "2017-11-04T19:05:52.168927: step 336, loss 0.701806, acc 0.65625\n",
      "2017-11-04T19:05:52.472039: step 337, loss 0.97033, acc 0.53125\n",
      "2017-11-04T19:05:52.781641: step 338, loss 0.746241, acc 0.609375\n",
      "2017-11-04T19:05:53.077329: step 339, loss 0.823031, acc 0.5625\n",
      "2017-11-04T19:05:53.423963: step 340, loss 0.600129, acc 0.703125\n",
      "2017-11-04T19:05:53.680443: step 341, loss 0.583742, acc 0.640625\n",
      "2017-11-04T19:05:53.971720: step 342, loss 0.665686, acc 0.71875\n",
      "2017-11-04T19:05:54.208049: step 343, loss 0.826634, acc 0.625\n",
      "2017-11-04T19:05:54.452440: step 344, loss 0.720703, acc 0.6875\n",
      "2017-11-04T19:05:54.746579: step 345, loss 0.55324, acc 0.671875\n",
      "2017-11-04T19:05:55.018964: step 346, loss 1.06452, acc 0.578125\n",
      "2017-11-04T19:05:55.344933: step 347, loss 0.645213, acc 0.6875\n",
      "2017-11-04T19:05:55.698819: step 348, loss 0.672833, acc 0.6875\n",
      "2017-11-04T19:05:55.984782: step 349, loss 0.592566, acc 0.671875\n",
      "2017-11-04T19:05:56.265464: step 350, loss 0.615033, acc 0.71875\n",
      "2017-11-04T19:05:56.548843: step 351, loss 0.563044, acc 0.75\n",
      "2017-11-04T19:05:56.826671: step 352, loss 0.678898, acc 0.640625\n",
      "2017-11-04T19:05:57.095917: step 353, loss 0.59365, acc 0.734375\n",
      "2017-11-04T19:05:57.378038: step 354, loss 0.668099, acc 0.671875\n",
      "2017-11-04T19:05:57.683777: step 355, loss 0.563766, acc 0.75\n",
      "2017-11-04T19:05:57.990411: step 356, loss 0.950989, acc 0.578125\n",
      "2017-11-04T19:05:58.310481: step 357, loss 0.651839, acc 0.6875\n",
      "2017-11-04T19:05:58.567594: step 358, loss 0.683144, acc 0.625\n",
      "2017-11-04T19:05:58.851007: step 359, loss 0.565832, acc 0.734375\n",
      "2017-11-04T19:05:59.127427: step 360, loss 0.446343, acc 0.796875\n",
      "2017-11-04T19:05:59.405618: step 361, loss 0.708534, acc 0.640625\n",
      "2017-11-04T19:05:59.686422: step 362, loss 0.72625, acc 0.65625\n",
      "2017-11-04T19:06:00.000941: step 363, loss 0.691871, acc 0.734375\n",
      "2017-11-04T19:06:00.293537: step 364, loss 0.808859, acc 0.578125\n",
      "2017-11-04T19:06:00.535776: step 365, loss 0.862393, acc 0.65625\n",
      "2017-11-04T19:06:00.856099: step 366, loss 0.696989, acc 0.65625\n",
      "2017-11-04T19:06:01.147602: step 367, loss 0.586457, acc 0.734375\n",
      "2017-11-04T19:06:01.479474: step 368, loss 0.486384, acc 0.6875\n",
      "2017-11-04T19:06:01.789625: step 369, loss 0.614964, acc 0.65625\n",
      "2017-11-04T19:06:02.064517: step 370, loss 0.457276, acc 0.703125\n",
      "2017-11-04T19:06:02.358370: step 371, loss 0.709562, acc 0.671875\n",
      "2017-11-04T19:06:02.640589: step 372, loss 0.632735, acc 0.703125\n",
      "2017-11-04T19:06:03.008512: step 373, loss 0.859383, acc 0.640625\n",
      "2017-11-04T19:06:03.230568: step 374, loss 0.712705, acc 0.703125\n",
      "2017-11-04T19:06:03.535108: step 375, loss 0.582027, acc 0.671875\n",
      "2017-11-04T19:06:03.812332: step 376, loss 0.667132, acc 0.671875\n",
      "2017-11-04T19:06:04.133636: step 377, loss 0.739715, acc 0.625\n",
      "2017-11-04T19:06:04.435813: step 378, loss 0.570017, acc 0.703125\n",
      "2017-11-04T19:06:04.671206: step 379, loss 0.598956, acc 0.6875\n",
      "2017-11-04T19:06:05.070698: step 380, loss 0.594756, acc 0.765625\n",
      "2017-11-04T19:06:05.330801: step 381, loss 0.701358, acc 0.640625\n",
      "2017-11-04T19:06:05.639608: step 382, loss 0.812922, acc 0.640625\n",
      "2017-11-04T19:06:05.935473: step 383, loss 0.695123, acc 0.65625\n",
      "2017-11-04T19:06:06.302281: step 384, loss 0.665654, acc 0.71875\n",
      "2017-11-04T19:06:06.638064: step 385, loss 0.70105, acc 0.71875\n",
      "2017-11-04T19:06:06.914595: step 386, loss 0.784045, acc 0.625\n",
      "2017-11-04T19:06:07.217512: step 387, loss 0.766321, acc 0.625\n",
      "2017-11-04T19:06:07.542475: step 388, loss 0.725148, acc 0.640625\n",
      "2017-11-04T19:06:07.881708: step 389, loss 0.749608, acc 0.640625\n",
      "2017-11-04T19:06:08.168046: step 390, loss 0.665708, acc 0.625\n",
      "2017-11-04T19:06:08.475222: step 391, loss 0.883988, acc 0.59375\n",
      "2017-11-04T19:06:08.756340: step 392, loss 0.476852, acc 0.734375\n",
      "2017-11-04T19:06:09.022996: step 393, loss 0.746024, acc 0.546875\n",
      "2017-11-04T19:06:09.328846: step 394, loss 0.736723, acc 0.65625\n",
      "2017-11-04T19:06:09.610735: step 395, loss 0.800292, acc 0.546875\n",
      "2017-11-04T19:06:09.862425: step 396, loss 0.612087, acc 0.6875\n",
      "2017-11-04T19:06:10.125586: step 397, loss 0.669429, acc 0.6875\n",
      "2017-11-04T19:06:10.385996: step 398, loss 0.560433, acc 0.734375\n",
      "2017-11-04T19:06:10.727657: step 399, loss 0.640804, acc 0.671875\n",
      "2017-11-04T19:06:11.071615: step 400, loss 0.657933, acc 0.625\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:06:12.039854: step 400, loss 0.639326, acc 0.625704\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-400\n",
      "\n",
      "2017-11-04T19:06:12.405231: step 401, loss 0.678936, acc 0.59375\n",
      "2017-11-04T19:06:12.685649: step 402, loss 0.953683, acc 0.515625\n",
      "2017-11-04T19:06:13.004892: step 403, loss 0.848116, acc 0.625\n",
      "2017-11-04T19:06:13.264369: step 404, loss 0.587389, acc 0.703125\n",
      "2017-11-04T19:06:13.556096: step 405, loss 0.723559, acc 0.6875\n",
      "2017-11-04T19:06:13.843735: step 406, loss 0.55241, acc 0.65625\n",
      "2017-11-04T19:06:14.105422: step 407, loss 0.787486, acc 0.5\n",
      "2017-11-04T19:06:14.416922: step 408, loss 0.780481, acc 0.546875\n",
      "2017-11-04T19:06:14.734588: step 409, loss 0.605513, acc 0.640625\n",
      "2017-11-04T19:06:14.996145: step 410, loss 0.624342, acc 0.671875\n",
      "2017-11-04T19:06:15.343023: step 411, loss 0.996449, acc 0.515625\n",
      "2017-11-04T19:06:15.601104: step 412, loss 0.601509, acc 0.734375\n",
      "2017-11-04T19:06:15.878309: step 413, loss 0.735281, acc 0.65625\n",
      "2017-11-04T19:06:16.136203: step 414, loss 0.621966, acc 0.75\n",
      "2017-11-04T19:06:16.457127: step 415, loss 0.674299, acc 0.703125\n",
      "2017-11-04T19:06:16.737192: step 416, loss 0.746291, acc 0.59375\n",
      "2017-11-04T19:06:17.028302: step 417, loss 0.806098, acc 0.640625\n",
      "2017-11-04T19:06:17.326339: step 418, loss 0.81586, acc 0.578125\n",
      "2017-11-04T19:06:17.721829: step 419, loss 0.611052, acc 0.65625\n",
      "2017-11-04T19:06:17.969303: step 420, loss 0.674008, acc 0.640625\n",
      "2017-11-04T19:06:18.341719: step 421, loss 0.598438, acc 0.640625\n",
      "2017-11-04T19:06:18.581860: step 422, loss 0.530784, acc 0.71875\n",
      "2017-11-04T19:06:18.985393: step 423, loss 0.650017, acc 0.6875\n",
      "2017-11-04T19:06:19.298505: step 424, loss 0.830332, acc 0.53125\n",
      "2017-11-04T19:06:19.694968: step 425, loss 0.585846, acc 0.671875\n",
      "2017-11-04T19:06:20.143464: step 426, loss 0.694591, acc 0.65625\n",
      "2017-11-04T19:06:20.540550: step 427, loss 0.463303, acc 0.75\n",
      "2017-11-04T19:06:20.942062: step 428, loss 0.630759, acc 0.671875\n",
      "2017-11-04T19:06:21.312230: step 429, loss 0.79184, acc 0.625\n",
      "2017-11-04T19:06:21.694031: step 430, loss 0.450171, acc 0.765625\n",
      "2017-11-04T19:06:21.994381: step 431, loss 0.785578, acc 0.5625\n",
      "2017-11-04T19:06:22.364922: step 432, loss 0.705018, acc 0.6875\n",
      "2017-11-04T19:06:22.699820: step 433, loss 0.565696, acc 0.75\n",
      "2017-11-04T19:06:23.067601: step 434, loss 0.59935, acc 0.75\n",
      "2017-11-04T19:06:23.375233: step 435, loss 0.565301, acc 0.765625\n",
      "2017-11-04T19:06:23.691861: step 436, loss 0.706058, acc 0.609375\n",
      "2017-11-04T19:06:24.000936: step 437, loss 0.728287, acc 0.625\n",
      "2017-11-04T19:06:24.278539: step 438, loss 0.838707, acc 0.6875\n",
      "2017-11-04T19:06:24.555443: step 439, loss 0.700135, acc 0.65625\n",
      "2017-11-04T19:06:24.827608: step 440, loss 0.623742, acc 0.671875\n",
      "2017-11-04T19:06:25.139729: step 441, loss 0.685827, acc 0.75\n",
      "2017-11-04T19:06:25.524284: step 442, loss 0.649342, acc 0.75\n",
      "2017-11-04T19:06:25.772494: step 443, loss 0.817074, acc 0.625\n",
      "2017-11-04T19:06:26.040913: step 444, loss 0.657731, acc 0.671875\n",
      "2017-11-04T19:06:26.357293: step 445, loss 0.591423, acc 0.6875\n",
      "2017-11-04T19:06:26.628934: step 446, loss 0.554087, acc 0.765625\n",
      "2017-11-04T19:06:26.927148: step 447, loss 0.658713, acc 0.6875\n",
      "2017-11-04T19:06:27.232609: step 448, loss 0.761469, acc 0.625\n",
      "2017-11-04T19:06:27.464425: step 449, loss 0.6964, acc 0.578125\n",
      "2017-11-04T19:06:27.792361: step 450, loss 0.584883, acc 0.666667\n",
      "2017-11-04T19:06:28.116921: step 451, loss 0.734255, acc 0.59375\n",
      "2017-11-04T19:06:28.432914: step 452, loss 0.498042, acc 0.6875\n",
      "2017-11-04T19:06:28.644433: step 453, loss 0.661519, acc 0.640625\n",
      "2017-11-04T19:06:28.950659: step 454, loss 0.622503, acc 0.734375\n",
      "2017-11-04T19:06:29.247991: step 455, loss 0.650628, acc 0.703125\n",
      "2017-11-04T19:06:29.552163: step 456, loss 0.653292, acc 0.6875\n",
      "2017-11-04T19:06:29.851098: step 457, loss 0.678234, acc 0.703125\n",
      "2017-11-04T19:06:30.141117: step 458, loss 0.522228, acc 0.734375\n",
      "2017-11-04T19:06:30.401745: step 459, loss 0.583286, acc 0.703125\n",
      "2017-11-04T19:06:30.682385: step 460, loss 0.434764, acc 0.75\n",
      "2017-11-04T19:06:30.966626: step 461, loss 0.606587, acc 0.609375\n",
      "2017-11-04T19:06:31.284990: step 462, loss 0.653483, acc 0.6875\n",
      "2017-11-04T19:06:31.706200: step 463, loss 0.606254, acc 0.6875\n",
      "2017-11-04T19:06:32.134520: step 464, loss 0.60417, acc 0.65625\n",
      "2017-11-04T19:06:32.624398: step 465, loss 0.543968, acc 0.734375\n",
      "2017-11-04T19:06:32.978011: step 466, loss 0.57219, acc 0.734375\n",
      "2017-11-04T19:06:33.340928: step 467, loss 0.522003, acc 0.65625\n",
      "2017-11-04T19:06:33.613459: step 468, loss 0.471864, acc 0.75\n",
      "2017-11-04T19:06:33.901438: step 469, loss 0.488301, acc 0.734375\n",
      "2017-11-04T19:06:34.212556: step 470, loss 0.551051, acc 0.734375\n",
      "2017-11-04T19:06:34.656325: step 471, loss 0.625322, acc 0.71875\n",
      "2017-11-04T19:06:34.987352: step 472, loss 0.59981, acc 0.671875\n",
      "2017-11-04T19:06:35.383511: step 473, loss 0.504028, acc 0.734375\n",
      "2017-11-04T19:06:35.749970: step 474, loss 0.567613, acc 0.75\n",
      "2017-11-04T19:06:36.088390: step 475, loss 0.556805, acc 0.71875\n",
      "2017-11-04T19:06:36.384316: step 476, loss 0.640275, acc 0.640625\n",
      "2017-11-04T19:06:36.657918: step 477, loss 0.483165, acc 0.796875\n",
      "2017-11-04T19:06:37.105982: step 478, loss 0.633494, acc 0.734375\n",
      "2017-11-04T19:06:37.480676: step 479, loss 0.69352, acc 0.65625\n",
      "2017-11-04T19:06:37.863160: step 480, loss 0.639755, acc 0.609375\n",
      "2017-11-04T19:06:38.229190: step 481, loss 0.653102, acc 0.6875\n",
      "2017-11-04T19:06:38.473361: step 482, loss 0.599913, acc 0.71875\n",
      "2017-11-04T19:06:38.751346: step 483, loss 0.728024, acc 0.59375\n",
      "2017-11-04T19:06:39.017236: step 484, loss 0.732208, acc 0.65625\n",
      "2017-11-04T19:06:39.300457: step 485, loss 0.760872, acc 0.640625\n",
      "2017-11-04T19:06:39.547307: step 486, loss 0.648856, acc 0.6875\n",
      "2017-11-04T19:06:39.821457: step 487, loss 0.593384, acc 0.71875\n",
      "2017-11-04T19:06:40.078682: step 488, loss 0.568856, acc 0.734375\n",
      "2017-11-04T19:06:40.354198: step 489, loss 0.504128, acc 0.78125\n",
      "2017-11-04T19:06:40.660897: step 490, loss 0.71426, acc 0.671875\n",
      "2017-11-04T19:06:40.924738: step 491, loss 0.615858, acc 0.734375\n",
      "2017-11-04T19:06:41.370765: step 492, loss 0.563411, acc 0.671875\n",
      "2017-11-04T19:06:41.595885: step 493, loss 0.529095, acc 0.71875\n",
      "2017-11-04T19:06:41.904921: step 494, loss 0.52546, acc 0.734375\n",
      "2017-11-04T19:06:42.173067: step 495, loss 0.560488, acc 0.703125\n",
      "2017-11-04T19:06:42.504122: step 496, loss 0.688503, acc 0.640625\n",
      "2017-11-04T19:06:42.857117: step 497, loss 0.618026, acc 0.640625\n",
      "2017-11-04T19:06:43.214484: step 498, loss 0.54268, acc 0.71875\n",
      "2017-11-04T19:06:43.564928: step 499, loss 0.702983, acc 0.625\n",
      "2017-11-04T19:06:43.922099: step 500, loss 0.57108, acc 0.78125\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:06:44.802237: step 500, loss 0.618389, acc 0.655722\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-500\n",
      "\n",
      "2017-11-04T19:06:45.156882: step 501, loss 0.63989, acc 0.703125\n",
      "2017-11-04T19:06:45.504629: step 502, loss 0.540176, acc 0.703125\n",
      "2017-11-04T19:06:45.901668: step 503, loss 0.569776, acc 0.640625\n",
      "2017-11-04T19:06:46.180918: step 504, loss 0.55313, acc 0.78125\n",
      "2017-11-04T19:06:46.456659: step 505, loss 0.538674, acc 0.734375\n",
      "2017-11-04T19:06:46.802191: step 506, loss 0.552734, acc 0.71875\n",
      "2017-11-04T19:06:47.079687: step 507, loss 0.633351, acc 0.671875\n",
      "2017-11-04T19:06:47.390978: step 508, loss 0.581914, acc 0.6875\n",
      "2017-11-04T19:06:47.710619: step 509, loss 0.610196, acc 0.703125\n",
      "2017-11-04T19:06:47.956926: step 510, loss 0.542452, acc 0.734375\n",
      "2017-11-04T19:06:48.231166: step 511, loss 0.57636, acc 0.765625\n",
      "2017-11-04T19:06:48.477130: step 512, loss 0.675263, acc 0.703125\n",
      "2017-11-04T19:06:48.745914: step 513, loss 0.674517, acc 0.671875\n",
      "2017-11-04T19:06:49.077837: step 514, loss 0.654456, acc 0.6875\n",
      "2017-11-04T19:06:49.373664: step 515, loss 0.74586, acc 0.5625\n",
      "2017-11-04T19:06:49.622233: step 516, loss 0.573636, acc 0.71875\n",
      "2017-11-04T19:06:49.956341: step 517, loss 0.664713, acc 0.75\n",
      "2017-11-04T19:06:50.266313: step 518, loss 0.487988, acc 0.6875\n",
      "2017-11-04T19:06:50.532968: step 519, loss 0.57376, acc 0.71875\n",
      "2017-11-04T19:06:50.878892: step 520, loss 0.475909, acc 0.75\n",
      "2017-11-04T19:06:51.299026: step 521, loss 0.505672, acc 0.75\n",
      "2017-11-04T19:06:51.693957: step 522, loss 0.709569, acc 0.671875\n",
      "2017-11-04T19:06:52.059413: step 523, loss 0.495442, acc 0.734375\n",
      "2017-11-04T19:06:52.373905: step 524, loss 0.504983, acc 0.703125\n",
      "2017-11-04T19:06:52.728013: step 525, loss 0.641525, acc 0.6875\n",
      "2017-11-04T19:06:53.020986: step 526, loss 0.666403, acc 0.65625\n",
      "2017-11-04T19:06:53.328714: step 527, loss 0.522893, acc 0.75\n",
      "2017-11-04T19:06:53.630623: step 528, loss 0.512056, acc 0.765625\n",
      "2017-11-04T19:06:53.956237: step 529, loss 0.510626, acc 0.71875\n",
      "2017-11-04T19:06:54.311453: step 530, loss 0.565201, acc 0.75\n",
      "2017-11-04T19:06:54.643503: step 531, loss 0.589741, acc 0.75\n",
      "2017-11-04T19:06:54.960161: step 532, loss 0.575506, acc 0.703125\n",
      "2017-11-04T19:06:55.288127: step 533, loss 0.557577, acc 0.71875\n",
      "2017-11-04T19:06:55.587886: step 534, loss 0.434985, acc 0.8125\n",
      "2017-11-04T19:06:55.870277: step 535, loss 0.502625, acc 0.6875\n",
      "2017-11-04T19:06:56.153700: step 536, loss 0.736379, acc 0.640625\n",
      "2017-11-04T19:06:56.429510: step 537, loss 0.505787, acc 0.75\n",
      "2017-11-04T19:06:56.692623: step 538, loss 0.69244, acc 0.640625\n",
      "2017-11-04T19:06:56.935293: step 539, loss 0.616474, acc 0.703125\n",
      "2017-11-04T19:06:57.186758: step 540, loss 0.685013, acc 0.640625\n",
      "2017-11-04T19:06:57.556758: step 541, loss 0.576894, acc 0.640625\n",
      "2017-11-04T19:06:57.881041: step 542, loss 0.638336, acc 0.734375\n",
      "2017-11-04T19:06:58.217853: step 543, loss 0.428918, acc 0.796875\n",
      "2017-11-04T19:06:58.558558: step 544, loss 0.688103, acc 0.671875\n",
      "2017-11-04T19:06:58.874449: step 545, loss 0.592129, acc 0.65625\n",
      "2017-11-04T19:06:59.188727: step 546, loss 0.668644, acc 0.640625\n",
      "2017-11-04T19:06:59.574452: step 547, loss 0.56097, acc 0.765625\n",
      "2017-11-04T19:06:59.867201: step 548, loss 0.480649, acc 0.8125\n",
      "2017-11-04T19:07:00.179979: step 549, loss 0.558597, acc 0.6875\n",
      "2017-11-04T19:07:00.543700: step 550, loss 0.566557, acc 0.75\n",
      "2017-11-04T19:07:00.822915: step 551, loss 0.53991, acc 0.75\n",
      "2017-11-04T19:07:01.132931: step 552, loss 0.67902, acc 0.703125\n",
      "2017-11-04T19:07:01.455155: step 553, loss 0.540143, acc 0.703125\n",
      "2017-11-04T19:07:01.797399: step 554, loss 0.430446, acc 0.84375\n",
      "2017-11-04T19:07:02.082541: step 555, loss 0.624208, acc 0.765625\n",
      "2017-11-04T19:07:02.346182: step 556, loss 0.69885, acc 0.734375\n",
      "2017-11-04T19:07:02.767691: step 557, loss 0.582611, acc 0.671875\n",
      "2017-11-04T19:07:03.048456: step 558, loss 0.568637, acc 0.78125\n",
      "2017-11-04T19:07:03.330060: step 559, loss 0.475049, acc 0.796875\n",
      "2017-11-04T19:07:03.740923: step 560, loss 0.546591, acc 0.703125\n",
      "2017-11-04T19:07:04.012953: step 561, loss 0.543746, acc 0.734375\n",
      "2017-11-04T19:07:04.389630: step 562, loss 0.526205, acc 0.734375\n",
      "2017-11-04T19:07:04.641871: step 563, loss 0.592744, acc 0.671875\n",
      "2017-11-04T19:07:04.930646: step 564, loss 0.546587, acc 0.734375\n",
      "2017-11-04T19:07:05.234902: step 565, loss 0.47463, acc 0.734375\n",
      "2017-11-04T19:07:05.631390: step 566, loss 0.605449, acc 0.65625\n",
      "2017-11-04T19:07:05.912946: step 567, loss 0.513903, acc 0.75\n",
      "2017-11-04T19:07:06.207995: step 568, loss 0.500445, acc 0.765625\n",
      "2017-11-04T19:07:06.627696: step 569, loss 0.55673, acc 0.71875\n",
      "2017-11-04T19:07:06.966705: step 570, loss 0.501582, acc 0.75\n",
      "2017-11-04T19:07:07.267411: step 571, loss 0.611792, acc 0.65625\n",
      "2017-11-04T19:07:07.548786: step 572, loss 0.596899, acc 0.671875\n",
      "2017-11-04T19:07:07.853926: step 573, loss 0.476259, acc 0.734375\n",
      "2017-11-04T19:07:08.198989: step 574, loss 0.585002, acc 0.703125\n",
      "2017-11-04T19:07:08.496303: step 575, loss 0.514839, acc 0.765625\n",
      "2017-11-04T19:07:08.860511: step 576, loss 0.488607, acc 0.734375\n",
      "2017-11-04T19:07:09.154336: step 577, loss 0.633522, acc 0.71875\n",
      "2017-11-04T19:07:09.499178: step 578, loss 0.373171, acc 0.828125\n",
      "2017-11-04T19:07:09.794783: step 579, loss 0.613093, acc 0.703125\n",
      "2017-11-04T19:07:10.093367: step 580, loss 0.584276, acc 0.6875\n",
      "2017-11-04T19:07:10.472963: step 581, loss 0.504845, acc 0.78125\n",
      "2017-11-04T19:07:10.816941: step 582, loss 0.527293, acc 0.734375\n",
      "2017-11-04T19:07:11.264442: step 583, loss 0.496279, acc 0.75\n",
      "2017-11-04T19:07:11.608922: step 584, loss 0.517295, acc 0.75\n",
      "2017-11-04T19:07:12.013385: step 585, loss 0.537878, acc 0.75\n",
      "2017-11-04T19:07:12.319235: step 586, loss 0.520617, acc 0.734375\n",
      "2017-11-04T19:07:12.718352: step 587, loss 0.506455, acc 0.734375\n",
      "2017-11-04T19:07:12.994215: step 588, loss 0.600986, acc 0.671875\n",
      "2017-11-04T19:07:13.263718: step 589, loss 0.611177, acc 0.625\n",
      "2017-11-04T19:07:13.602088: step 590, loss 0.618158, acc 0.71875\n",
      "2017-11-04T19:07:13.855991: step 591, loss 0.583934, acc 0.75\n",
      "2017-11-04T19:07:14.178568: step 592, loss 0.518157, acc 0.75\n",
      "2017-11-04T19:07:14.551653: step 593, loss 0.532161, acc 0.703125\n",
      "2017-11-04T19:07:14.903930: step 594, loss 0.592399, acc 0.765625\n",
      "2017-11-04T19:07:15.170745: step 595, loss 0.651523, acc 0.65625\n",
      "2017-11-04T19:07:15.445179: step 596, loss 0.597843, acc 0.6875\n",
      "2017-11-04T19:07:15.848932: step 597, loss 0.61988, acc 0.65625\n",
      "2017-11-04T19:07:16.214057: step 598, loss 0.593318, acc 0.75\n",
      "2017-11-04T19:07:16.521060: step 599, loss 0.555042, acc 0.78125\n",
      "2017-11-04T19:07:16.785181: step 600, loss 0.724173, acc 0.6\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:07:17.777119: step 600, loss 0.615031, acc 0.635084\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-600\n",
      "\n",
      "2017-11-04T19:07:18.170117: step 601, loss 0.595198, acc 0.65625\n",
      "2017-11-04T19:07:18.473414: step 602, loss 0.472079, acc 0.75\n",
      "2017-11-04T19:07:18.814519: step 603, loss 0.503993, acc 0.796875\n",
      "2017-11-04T19:07:19.125820: step 604, loss 0.544913, acc 0.6875\n",
      "2017-11-04T19:07:19.474432: step 605, loss 0.534131, acc 0.75\n",
      "2017-11-04T19:07:19.758644: step 606, loss 0.415639, acc 0.78125\n",
      "2017-11-04T19:07:20.069298: step 607, loss 0.602463, acc 0.734375\n",
      "2017-11-04T19:07:20.388610: step 608, loss 0.598988, acc 0.71875\n",
      "2017-11-04T19:07:20.759512: step 609, loss 0.634758, acc 0.640625\n",
      "2017-11-04T19:07:21.084731: step 610, loss 0.422787, acc 0.8125\n",
      "2017-11-04T19:07:21.409033: step 611, loss 0.782082, acc 0.59375\n",
      "2017-11-04T19:07:21.729959: step 612, loss 0.502395, acc 0.765625\n",
      "2017-11-04T19:07:22.164457: step 613, loss 0.490208, acc 0.78125\n",
      "2017-11-04T19:07:22.496295: step 614, loss 0.668477, acc 0.703125\n",
      "2017-11-04T19:07:22.794163: step 615, loss 0.575773, acc 0.765625\n",
      "2017-11-04T19:07:23.065544: step 616, loss 0.473222, acc 0.734375\n",
      "2017-11-04T19:07:23.327535: step 617, loss 0.459172, acc 0.796875\n",
      "2017-11-04T19:07:23.598197: step 618, loss 0.566774, acc 0.6875\n",
      "2017-11-04T19:07:23.881189: step 619, loss 0.541939, acc 0.71875\n",
      "2017-11-04T19:07:24.178422: step 620, loss 0.579684, acc 0.734375\n",
      "2017-11-04T19:07:24.490777: step 621, loss 0.556003, acc 0.734375\n",
      "2017-11-04T19:07:24.813537: step 622, loss 0.474518, acc 0.796875\n",
      "2017-11-04T19:07:25.102322: step 623, loss 0.485034, acc 0.796875\n",
      "2017-11-04T19:07:25.390103: step 624, loss 0.44616, acc 0.84375\n",
      "2017-11-04T19:07:25.690069: step 625, loss 0.525494, acc 0.734375\n",
      "2017-11-04T19:07:25.912954: step 626, loss 0.3537, acc 0.890625\n",
      "2017-11-04T19:07:26.193556: step 627, loss 0.440625, acc 0.765625\n",
      "2017-11-04T19:07:26.505981: step 628, loss 0.50622, acc 0.71875\n",
      "2017-11-04T19:07:26.898757: step 629, loss 0.490239, acc 0.734375\n",
      "2017-11-04T19:07:27.200359: step 630, loss 0.523455, acc 0.734375\n",
      "2017-11-04T19:07:27.548203: step 631, loss 0.50301, acc 0.765625\n",
      "2017-11-04T19:07:27.899288: step 632, loss 0.483808, acc 0.828125\n",
      "2017-11-04T19:07:28.279591: step 633, loss 0.475439, acc 0.78125\n",
      "2017-11-04T19:07:28.665506: step 634, loss 0.472928, acc 0.8125\n",
      "2017-11-04T19:07:29.146244: step 635, loss 0.480108, acc 0.765625\n",
      "2017-11-04T19:07:29.620117: step 636, loss 0.323757, acc 0.90625\n",
      "2017-11-04T19:07:29.982177: step 637, loss 0.549559, acc 0.734375\n",
      "2017-11-04T19:07:30.369201: step 638, loss 0.459878, acc 0.8125\n",
      "2017-11-04T19:07:30.765221: step 639, loss 0.530622, acc 0.734375\n",
      "2017-11-04T19:07:31.161477: step 640, loss 0.414632, acc 0.75\n",
      "2017-11-04T19:07:31.532022: step 641, loss 0.46613, acc 0.75\n",
      "2017-11-04T19:07:31.880983: step 642, loss 0.504077, acc 0.78125\n",
      "2017-11-04T19:07:32.170240: step 643, loss 0.511018, acc 0.75\n",
      "2017-11-04T19:07:32.413265: step 644, loss 0.460418, acc 0.734375\n",
      "2017-11-04T19:07:32.792380: step 645, loss 0.555627, acc 0.71875\n",
      "2017-11-04T19:07:33.100918: step 646, loss 0.451977, acc 0.796875\n",
      "2017-11-04T19:07:33.431599: step 647, loss 0.517084, acc 0.734375\n",
      "2017-11-04T19:07:33.752920: step 648, loss 0.41582, acc 0.8125\n",
      "2017-11-04T19:07:34.034149: step 649, loss 0.424531, acc 0.8125\n",
      "2017-11-04T19:07:34.242632: step 650, loss 0.438515, acc 0.828125\n",
      "2017-11-04T19:07:34.531160: step 651, loss 0.560989, acc 0.734375\n",
      "2017-11-04T19:07:34.924783: step 652, loss 0.531255, acc 0.71875\n",
      "2017-11-04T19:07:35.271264: step 653, loss 0.473715, acc 0.8125\n",
      "2017-11-04T19:07:35.628454: step 654, loss 0.376659, acc 0.828125\n",
      "2017-11-04T19:07:35.970439: step 655, loss 0.470716, acc 0.75\n",
      "2017-11-04T19:07:36.371664: step 656, loss 0.47279, acc 0.734375\n",
      "2017-11-04T19:07:36.652678: step 657, loss 0.46145, acc 0.796875\n",
      "2017-11-04T19:07:36.950928: step 658, loss 0.59807, acc 0.71875\n",
      "2017-11-04T19:07:37.239888: step 659, loss 0.404167, acc 0.796875\n",
      "2017-11-04T19:07:37.504379: step 660, loss 0.400238, acc 0.765625\n",
      "2017-11-04T19:07:37.852917: step 661, loss 0.536002, acc 0.703125\n",
      "2017-11-04T19:07:38.136073: step 662, loss 0.33605, acc 0.859375\n",
      "2017-11-04T19:07:38.385697: step 663, loss 0.585829, acc 0.6875\n",
      "2017-11-04T19:07:38.725213: step 664, loss 0.448698, acc 0.765625\n",
      "2017-11-04T19:07:39.015321: step 665, loss 0.617801, acc 0.65625\n",
      "2017-11-04T19:07:39.249337: step 666, loss 0.451347, acc 0.796875\n",
      "2017-11-04T19:07:39.620737: step 667, loss 0.675757, acc 0.65625\n",
      "2017-11-04T19:07:40.006083: step 668, loss 0.452083, acc 0.765625\n",
      "2017-11-04T19:07:40.303028: step 669, loss 0.52915, acc 0.71875\n",
      "2017-11-04T19:07:40.608927: step 670, loss 0.524622, acc 0.734375\n",
      "2017-11-04T19:07:40.892519: step 671, loss 0.595297, acc 0.71875\n",
      "2017-11-04T19:07:41.165274: step 672, loss 0.523013, acc 0.6875\n",
      "2017-11-04T19:07:41.506312: step 673, loss 0.429397, acc 0.8125\n",
      "2017-11-04T19:07:41.785553: step 674, loss 0.489646, acc 0.8125\n",
      "2017-11-04T19:07:42.095072: step 675, loss 0.536878, acc 0.734375\n",
      "2017-11-04T19:07:42.318375: step 676, loss 0.701573, acc 0.65625\n",
      "2017-11-04T19:07:42.693589: step 677, loss 0.582781, acc 0.65625\n",
      "2017-11-04T19:07:42.928350: step 678, loss 0.590027, acc 0.734375\n",
      "2017-11-04T19:07:43.166086: step 679, loss 0.464817, acc 0.78125\n",
      "2017-11-04T19:07:43.587705: step 680, loss 0.409916, acc 0.78125\n",
      "2017-11-04T19:07:43.887052: step 681, loss 0.492053, acc 0.71875\n",
      "2017-11-04T19:07:44.141070: step 682, loss 0.545693, acc 0.6875\n",
      "2017-11-04T19:07:44.506682: step 683, loss 0.560425, acc 0.734375\n",
      "2017-11-04T19:07:44.823535: step 684, loss 0.488009, acc 0.78125\n",
      "2017-11-04T19:07:45.197368: step 685, loss 0.598009, acc 0.703125\n",
      "2017-11-04T19:07:45.585940: step 686, loss 0.444367, acc 0.78125\n",
      "2017-11-04T19:07:45.931161: step 687, loss 0.525254, acc 0.75\n",
      "2017-11-04T19:07:46.179273: step 688, loss 0.468958, acc 0.78125\n",
      "2017-11-04T19:07:46.435901: step 689, loss 0.511195, acc 0.75\n",
      "2017-11-04T19:07:46.816037: step 690, loss 0.459787, acc 0.75\n",
      "2017-11-04T19:07:47.166372: step 691, loss 0.428068, acc 0.765625\n",
      "2017-11-04T19:07:47.504686: step 692, loss 0.534621, acc 0.734375\n",
      "2017-11-04T19:07:47.792931: step 693, loss 0.628385, acc 0.703125\n",
      "2017-11-04T19:07:48.071813: step 694, loss 0.479734, acc 0.8125\n",
      "2017-11-04T19:07:48.390448: step 695, loss 0.456364, acc 0.8125\n",
      "2017-11-04T19:07:48.691672: step 696, loss 0.53167, acc 0.734375\n",
      "2017-11-04T19:07:49.002916: step 697, loss 0.48986, acc 0.75\n",
      "2017-11-04T19:07:49.351227: step 698, loss 0.471845, acc 0.75\n",
      "2017-11-04T19:07:49.684221: step 699, loss 0.626925, acc 0.734375\n",
      "2017-11-04T19:07:49.980985: step 700, loss 0.524864, acc 0.71875\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:07:50.938681: step 700, loss 0.597385, acc 0.657598\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-700\n",
      "\n",
      "2017-11-04T19:07:51.354558: step 701, loss 0.558711, acc 0.765625\n",
      "2017-11-04T19:07:51.614590: step 702, loss 0.487592, acc 0.71875\n",
      "2017-11-04T19:07:51.916135: step 703, loss 0.651711, acc 0.625\n",
      "2017-11-04T19:07:52.167574: step 704, loss 0.497001, acc 0.765625\n",
      "2017-11-04T19:07:52.483320: step 705, loss 0.493056, acc 0.71875\n",
      "2017-11-04T19:07:52.782419: step 706, loss 0.497003, acc 0.75\n",
      "2017-11-04T19:07:53.012921: step 707, loss 0.422702, acc 0.78125\n",
      "2017-11-04T19:07:53.292518: step 708, loss 0.486065, acc 0.75\n",
      "2017-11-04T19:07:53.601286: step 709, loss 0.544194, acc 0.703125\n",
      "2017-11-04T19:07:53.860524: step 710, loss 0.575609, acc 0.71875\n",
      "2017-11-04T19:07:54.191184: step 711, loss 0.478246, acc 0.71875\n",
      "2017-11-04T19:07:54.562634: step 712, loss 0.609791, acc 0.71875\n",
      "2017-11-04T19:07:54.965207: step 713, loss 0.586732, acc 0.65625\n",
      "2017-11-04T19:07:55.290789: step 714, loss 0.566579, acc 0.75\n",
      "2017-11-04T19:07:55.642941: step 715, loss 0.66169, acc 0.640625\n",
      "2017-11-04T19:07:55.934202: step 716, loss 0.515188, acc 0.75\n",
      "2017-11-04T19:07:56.224763: step 717, loss 0.473852, acc 0.765625\n",
      "2017-11-04T19:07:56.568743: step 718, loss 0.566559, acc 0.71875\n",
      "2017-11-04T19:07:56.971545: step 719, loss 0.496551, acc 0.78125\n",
      "2017-11-04T19:07:57.294933: step 720, loss 0.546584, acc 0.71875\n",
      "2017-11-04T19:07:57.640933: step 721, loss 0.423416, acc 0.765625\n",
      "2017-11-04T19:07:57.980935: step 722, loss 0.620994, acc 0.671875\n",
      "2017-11-04T19:07:58.436917: step 723, loss 0.521302, acc 0.75\n",
      "2017-11-04T19:07:58.774135: step 724, loss 0.414151, acc 0.828125\n",
      "2017-11-04T19:07:59.138429: step 725, loss 0.522584, acc 0.75\n",
      "2017-11-04T19:07:59.536638: step 726, loss 0.406741, acc 0.796875\n",
      "2017-11-04T19:07:59.837102: step 727, loss 0.554702, acc 0.6875\n",
      "2017-11-04T19:08:00.270028: step 728, loss 0.465621, acc 0.796875\n",
      "2017-11-04T19:08:00.589351: step 729, loss 0.617134, acc 0.625\n",
      "2017-11-04T19:08:00.974253: step 730, loss 0.400688, acc 0.84375\n",
      "2017-11-04T19:08:01.349123: step 731, loss 0.580822, acc 0.734375\n",
      "2017-11-04T19:08:01.714638: step 732, loss 0.502912, acc 0.75\n",
      "2017-11-04T19:08:02.027990: step 733, loss 0.456079, acc 0.78125\n",
      "2017-11-04T19:08:02.369081: step 734, loss 0.339164, acc 0.890625\n",
      "2017-11-04T19:08:02.728921: step 735, loss 0.58019, acc 0.703125\n",
      "2017-11-04T19:08:03.062928: step 736, loss 0.477356, acc 0.75\n",
      "2017-11-04T19:08:03.388929: step 737, loss 0.614967, acc 0.640625\n",
      "2017-11-04T19:08:03.759811: step 738, loss 0.521804, acc 0.734375\n",
      "2017-11-04T19:08:04.060909: step 739, loss 0.52434, acc 0.75\n",
      "2017-11-04T19:08:04.360750: step 740, loss 0.464242, acc 0.75\n",
      "2017-11-04T19:08:04.676059: step 741, loss 0.56635, acc 0.765625\n",
      "2017-11-04T19:08:05.009295: step 742, loss 0.504084, acc 0.71875\n",
      "2017-11-04T19:08:05.309154: step 743, loss 0.58017, acc 0.75\n",
      "2017-11-04T19:08:05.683865: step 744, loss 0.603801, acc 0.71875\n",
      "2017-11-04T19:08:06.030778: step 745, loss 0.535558, acc 0.734375\n",
      "2017-11-04T19:08:06.358339: step 746, loss 0.496989, acc 0.828125\n",
      "2017-11-04T19:08:06.733475: step 747, loss 0.410137, acc 0.8125\n",
      "2017-11-04T19:08:07.014044: step 748, loss 0.563751, acc 0.703125\n",
      "2017-11-04T19:08:07.284440: step 749, loss 0.332554, acc 0.859375\n",
      "2017-11-04T19:08:07.492829: step 750, loss 0.40776, acc 0.833333\n",
      "2017-11-04T19:08:07.768398: step 751, loss 0.326496, acc 0.859375\n",
      "2017-11-04T19:08:08.047087: step 752, loss 0.479636, acc 0.8125\n",
      "2017-11-04T19:08:08.346346: step 753, loss 0.401607, acc 0.859375\n",
      "2017-11-04T19:08:08.673003: step 754, loss 0.615971, acc 0.734375\n",
      "2017-11-04T19:08:08.939181: step 755, loss 0.495235, acc 0.75\n",
      "2017-11-04T19:08:09.309656: step 756, loss 0.431993, acc 0.78125\n",
      "2017-11-04T19:08:09.601301: step 757, loss 0.433155, acc 0.796875\n",
      "2017-11-04T19:08:09.859686: step 758, loss 0.340809, acc 0.859375\n",
      "2017-11-04T19:08:10.237331: step 759, loss 0.517004, acc 0.71875\n",
      "2017-11-04T19:08:10.470742: step 760, loss 0.444315, acc 0.828125\n",
      "2017-11-04T19:08:10.746964: step 761, loss 0.675951, acc 0.65625\n",
      "2017-11-04T19:08:11.039816: step 762, loss 0.340755, acc 0.875\n",
      "2017-11-04T19:08:11.357952: step 763, loss 0.386533, acc 0.859375\n",
      "2017-11-04T19:08:11.645337: step 764, loss 0.422606, acc 0.765625\n",
      "2017-11-04T19:08:11.955675: step 765, loss 0.40378, acc 0.828125\n",
      "2017-11-04T19:08:12.261782: step 766, loss 0.39884, acc 0.8125\n",
      "2017-11-04T19:08:12.553521: step 767, loss 0.400326, acc 0.8125\n",
      "2017-11-04T19:08:12.869330: step 768, loss 0.386239, acc 0.796875\n",
      "2017-11-04T19:08:13.115842: step 769, loss 0.349998, acc 0.859375\n",
      "2017-11-04T19:08:13.411202: step 770, loss 0.405505, acc 0.828125\n",
      "2017-11-04T19:08:13.742047: step 771, loss 0.497986, acc 0.796875\n",
      "2017-11-04T19:08:14.077976: step 772, loss 0.492877, acc 0.796875\n",
      "2017-11-04T19:08:14.380895: step 773, loss 0.596064, acc 0.671875\n",
      "2017-11-04T19:08:14.667691: step 774, loss 0.364871, acc 0.828125\n",
      "2017-11-04T19:08:14.996684: step 775, loss 0.414257, acc 0.84375\n",
      "2017-11-04T19:08:15.272933: step 776, loss 0.462168, acc 0.75\n",
      "2017-11-04T19:08:15.635499: step 777, loss 0.528768, acc 0.734375\n",
      "2017-11-04T19:08:15.927596: step 778, loss 0.366473, acc 0.859375\n",
      "2017-11-04T19:08:16.203044: step 779, loss 0.439782, acc 0.796875\n",
      "2017-11-04T19:08:16.579951: step 780, loss 0.569562, acc 0.796875\n",
      "2017-11-04T19:08:16.865277: step 781, loss 0.435106, acc 0.75\n",
      "2017-11-04T19:08:17.213563: step 782, loss 0.533743, acc 0.765625\n",
      "2017-11-04T19:08:17.544681: step 783, loss 0.356907, acc 0.875\n",
      "2017-11-04T19:08:17.859619: step 784, loss 0.465182, acc 0.75\n",
      "2017-11-04T19:08:18.117411: step 785, loss 0.414462, acc 0.828125\n",
      "2017-11-04T19:08:18.429705: step 786, loss 0.407916, acc 0.8125\n",
      "2017-11-04T19:08:18.663570: step 787, loss 0.447795, acc 0.796875\n",
      "2017-11-04T19:08:19.041512: step 788, loss 0.391273, acc 0.84375\n",
      "2017-11-04T19:08:19.327654: step 789, loss 0.514989, acc 0.78125\n",
      "2017-11-04T19:08:19.592484: step 790, loss 0.391977, acc 0.828125\n",
      "2017-11-04T19:08:19.938387: step 791, loss 0.441615, acc 0.828125\n",
      "2017-11-04T19:08:20.217025: step 792, loss 0.458078, acc 0.703125\n",
      "2017-11-04T19:08:20.455630: step 793, loss 0.504996, acc 0.8125\n",
      "2017-11-04T19:08:20.743194: step 794, loss 0.468683, acc 0.78125\n",
      "2017-11-04T19:08:21.048823: step 795, loss 0.4578, acc 0.75\n",
      "2017-11-04T19:08:21.332608: step 796, loss 0.550778, acc 0.78125\n",
      "2017-11-04T19:08:21.592920: step 797, loss 0.404984, acc 0.84375\n",
      "2017-11-04T19:08:21.995784: step 798, loss 0.460423, acc 0.78125\n",
      "2017-11-04T19:08:22.313615: step 799, loss 0.369151, acc 0.828125\n",
      "2017-11-04T19:08:22.548914: step 800, loss 0.611724, acc 0.671875\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:08:23.485704: step 800, loss 0.588869, acc 0.668856\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-800\n",
      "\n",
      "2017-11-04T19:08:23.840397: step 801, loss 0.525754, acc 0.703125\n",
      "2017-11-04T19:08:24.126776: step 802, loss 0.475937, acc 0.765625\n",
      "2017-11-04T19:08:24.382111: step 803, loss 0.487348, acc 0.75\n",
      "2017-11-04T19:08:24.655175: step 804, loss 0.382125, acc 0.828125\n",
      "2017-11-04T19:08:24.896921: step 805, loss 0.442546, acc 0.796875\n",
      "2017-11-04T19:08:25.181533: step 806, loss 0.399863, acc 0.859375\n",
      "2017-11-04T19:08:25.472888: step 807, loss 0.468392, acc 0.765625\n",
      "2017-11-04T19:08:25.802320: step 808, loss 0.458658, acc 0.78125\n",
      "2017-11-04T19:08:26.094070: step 809, loss 0.500128, acc 0.78125\n",
      "2017-11-04T19:08:26.361619: step 810, loss 0.420563, acc 0.78125\n",
      "2017-11-04T19:08:26.668424: step 811, loss 0.4546, acc 0.8125\n",
      "2017-11-04T19:08:26.942989: step 812, loss 0.515462, acc 0.703125\n",
      "2017-11-04T19:08:27.181005: step 813, loss 0.400816, acc 0.828125\n",
      "2017-11-04T19:08:27.461874: step 814, loss 0.512316, acc 0.75\n",
      "2017-11-04T19:08:27.753605: step 815, loss 0.447407, acc 0.8125\n",
      "2017-11-04T19:08:27.991585: step 816, loss 0.576533, acc 0.71875\n",
      "2017-11-04T19:08:28.288931: step 817, loss 0.415545, acc 0.78125\n",
      "2017-11-04T19:08:28.556947: step 818, loss 0.404822, acc 0.8125\n",
      "2017-11-04T19:08:28.841315: step 819, loss 0.349519, acc 0.84375\n",
      "2017-11-04T19:08:29.100445: step 820, loss 0.397032, acc 0.84375\n",
      "2017-11-04T19:08:29.387423: step 821, loss 0.416447, acc 0.78125\n",
      "2017-11-04T19:08:29.697354: step 822, loss 0.393832, acc 0.828125\n",
      "2017-11-04T19:08:30.027153: step 823, loss 0.427087, acc 0.8125\n",
      "2017-11-04T19:08:30.253287: step 824, loss 0.311719, acc 0.875\n",
      "2017-11-04T19:08:30.536968: step 825, loss 0.374518, acc 0.84375\n",
      "2017-11-04T19:08:30.883495: step 826, loss 0.401235, acc 0.765625\n",
      "2017-11-04T19:08:31.189201: step 827, loss 0.430936, acc 0.78125\n",
      "2017-11-04T19:08:31.487546: step 828, loss 0.409268, acc 0.78125\n",
      "2017-11-04T19:08:31.782385: step 829, loss 0.324427, acc 0.84375\n",
      "2017-11-04T19:08:32.046245: step 830, loss 0.328658, acc 0.890625\n",
      "2017-11-04T19:08:32.456622: step 831, loss 0.43664, acc 0.765625\n",
      "2017-11-04T19:08:32.817225: step 832, loss 0.33558, acc 0.875\n",
      "2017-11-04T19:08:33.149979: step 833, loss 0.445274, acc 0.796875\n",
      "2017-11-04T19:08:33.527801: step 834, loss 0.43178, acc 0.78125\n",
      "2017-11-04T19:08:33.939015: step 835, loss 0.464665, acc 0.75\n",
      "2017-11-04T19:08:34.317443: step 836, loss 0.655357, acc 0.671875\n",
      "2017-11-04T19:08:34.688914: step 837, loss 0.439235, acc 0.828125\n",
      "2017-11-04T19:08:35.092950: step 838, loss 0.453348, acc 0.796875\n",
      "2017-11-04T19:08:35.484924: step 839, loss 0.352048, acc 0.859375\n",
      "2017-11-04T19:08:35.881749: step 840, loss 0.54076, acc 0.71875\n",
      "2017-11-04T19:08:36.304948: step 841, loss 0.562735, acc 0.78125\n",
      "2017-11-04T19:08:36.633785: step 842, loss 0.484804, acc 0.8125\n",
      "2017-11-04T19:08:36.959349: step 843, loss 0.486015, acc 0.734375\n",
      "2017-11-04T19:08:37.256189: step 844, loss 0.459221, acc 0.765625\n",
      "2017-11-04T19:08:37.572860: step 845, loss 0.561485, acc 0.703125\n",
      "2017-11-04T19:08:37.882153: step 846, loss 0.481571, acc 0.828125\n",
      "2017-11-04T19:08:38.235787: step 847, loss 0.34941, acc 0.84375\n",
      "2017-11-04T19:08:38.484982: step 848, loss 0.460186, acc 0.78125\n",
      "2017-11-04T19:08:38.868987: step 849, loss 0.351495, acc 0.84375\n",
      "2017-11-04T19:08:39.133696: step 850, loss 0.537596, acc 0.6875\n",
      "2017-11-04T19:08:39.450975: step 851, loss 0.476064, acc 0.75\n",
      "2017-11-04T19:08:39.803167: step 852, loss 0.495041, acc 0.75\n",
      "2017-11-04T19:08:40.096852: step 853, loss 0.43759, acc 0.796875\n",
      "2017-11-04T19:08:40.450913: step 854, loss 0.557654, acc 0.75\n",
      "2017-11-04T19:08:40.733581: step 855, loss 0.417707, acc 0.84375\n",
      "2017-11-04T19:08:41.056037: step 856, loss 0.511021, acc 0.75\n",
      "2017-11-04T19:08:41.364831: step 857, loss 0.365284, acc 0.8125\n",
      "2017-11-04T19:08:41.585272: step 858, loss 0.421639, acc 0.859375\n",
      "2017-11-04T19:08:41.924661: step 859, loss 0.536337, acc 0.765625\n",
      "2017-11-04T19:08:42.283612: step 860, loss 0.323806, acc 0.875\n",
      "2017-11-04T19:08:42.551854: step 861, loss 0.416138, acc 0.78125\n",
      "2017-11-04T19:08:42.922985: step 862, loss 0.45041, acc 0.78125\n",
      "2017-11-04T19:08:43.229225: step 863, loss 0.522191, acc 0.6875\n",
      "2017-11-04T19:08:43.492747: step 864, loss 0.605639, acc 0.6875\n",
      "2017-11-04T19:08:43.810150: step 865, loss 0.403345, acc 0.8125\n",
      "2017-11-04T19:08:44.108100: step 866, loss 0.432917, acc 0.828125\n",
      "2017-11-04T19:08:44.486043: step 867, loss 0.552108, acc 0.671875\n",
      "2017-11-04T19:08:44.757713: step 868, loss 0.482587, acc 0.75\n",
      "2017-11-04T19:08:45.054817: step 869, loss 0.406344, acc 0.8125\n",
      "2017-11-04T19:08:45.319754: step 870, loss 0.360152, acc 0.84375\n",
      "2017-11-04T19:08:45.637012: step 871, loss 0.571112, acc 0.75\n",
      "2017-11-04T19:08:45.960541: step 872, loss 0.406651, acc 0.8125\n",
      "2017-11-04T19:08:46.308671: step 873, loss 0.508974, acc 0.8125\n",
      "2017-11-04T19:08:46.584927: step 874, loss 0.66659, acc 0.671875\n",
      "2017-11-04T19:08:46.872780: step 875, loss 0.445276, acc 0.78125\n",
      "2017-11-04T19:08:47.212330: step 876, loss 0.378602, acc 0.8125\n",
      "2017-11-04T19:08:47.461285: step 877, loss 0.338727, acc 0.84375\n",
      "2017-11-04T19:08:47.771784: step 878, loss 0.567239, acc 0.71875\n",
      "2017-11-04T19:08:48.035733: step 879, loss 0.444391, acc 0.8125\n",
      "2017-11-04T19:08:48.419941: step 880, loss 0.367832, acc 0.828125\n",
      "2017-11-04T19:08:48.740058: step 881, loss 0.467596, acc 0.796875\n",
      "2017-11-04T19:08:49.067376: step 882, loss 0.408447, acc 0.78125\n",
      "2017-11-04T19:08:49.405804: step 883, loss 0.487369, acc 0.78125\n",
      "2017-11-04T19:08:49.663922: step 884, loss 0.55705, acc 0.71875\n",
      "2017-11-04T19:08:50.006790: step 885, loss 0.54, acc 0.6875\n",
      "2017-11-04T19:08:50.358800: step 886, loss 0.454885, acc 0.75\n",
      "2017-11-04T19:08:50.699039: step 887, loss 0.527174, acc 0.78125\n",
      "2017-11-04T19:08:51.029560: step 888, loss 0.755849, acc 0.6875\n",
      "2017-11-04T19:08:51.408605: step 889, loss 0.34903, acc 0.828125\n",
      "2017-11-04T19:08:51.731299: step 890, loss 0.39049, acc 0.84375\n",
      "2017-11-04T19:08:52.050292: step 891, loss 0.510285, acc 0.734375\n",
      "2017-11-04T19:08:52.328394: step 892, loss 0.487454, acc 0.78125\n",
      "2017-11-04T19:08:52.596502: step 893, loss 0.519642, acc 0.75\n",
      "2017-11-04T19:08:53.012535: step 894, loss 0.484599, acc 0.78125\n",
      "2017-11-04T19:08:53.323292: step 895, loss 0.474354, acc 0.796875\n",
      "2017-11-04T19:08:53.597352: step 896, loss 0.329805, acc 0.84375\n",
      "2017-11-04T19:08:53.953722: step 897, loss 0.487684, acc 0.734375\n",
      "2017-11-04T19:08:54.276928: step 898, loss 0.407438, acc 0.859375\n",
      "2017-11-04T19:08:54.619498: step 899, loss 0.358306, acc 0.875\n",
      "2017-11-04T19:08:54.960649: step 900, loss 0.507203, acc 0.75\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:08:55.914647: step 900, loss 0.576821, acc 0.685741\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-900\n",
      "\n",
      "2017-11-04T19:08:56.287842: step 901, loss 0.348579, acc 0.828125\n",
      "2017-11-04T19:08:56.627524: step 902, loss 0.357333, acc 0.84375\n",
      "2017-11-04T19:08:56.890858: step 903, loss 0.368519, acc 0.84375\n",
      "2017-11-04T19:08:57.192189: step 904, loss 0.24613, acc 0.921875\n",
      "2017-11-04T19:08:57.504517: step 905, loss 0.267766, acc 0.890625\n",
      "2017-11-04T19:08:57.811069: step 906, loss 0.457202, acc 0.78125\n",
      "2017-11-04T19:08:58.096602: step 907, loss 0.268772, acc 0.921875\n",
      "2017-11-04T19:08:58.401557: step 908, loss 0.383971, acc 0.8125\n",
      "2017-11-04T19:08:58.690867: step 909, loss 0.459503, acc 0.78125\n",
      "2017-11-04T19:08:58.957337: step 910, loss 0.311197, acc 0.875\n",
      "2017-11-04T19:08:59.238166: step 911, loss 0.4175, acc 0.796875\n",
      "2017-11-04T19:08:59.508765: step 912, loss 0.28143, acc 0.9375\n",
      "2017-11-04T19:08:59.846960: step 913, loss 0.407349, acc 0.78125\n",
      "2017-11-04T19:09:00.194036: step 914, loss 0.368992, acc 0.84375\n",
      "2017-11-04T19:09:00.445742: step 915, loss 0.338167, acc 0.859375\n",
      "2017-11-04T19:09:00.762162: step 916, loss 0.331622, acc 0.90625\n",
      "2017-11-04T19:09:01.072282: step 917, loss 0.412871, acc 0.796875\n",
      "2017-11-04T19:09:01.317268: step 918, loss 0.227169, acc 0.921875\n",
      "2017-11-04T19:09:01.627120: step 919, loss 0.304384, acc 0.859375\n",
      "2017-11-04T19:09:01.932615: step 920, loss 0.414394, acc 0.765625\n",
      "2017-11-04T19:09:02.229676: step 921, loss 0.459377, acc 0.75\n",
      "2017-11-04T19:09:02.533118: step 922, loss 0.373134, acc 0.8125\n",
      "2017-11-04T19:09:02.877719: step 923, loss 0.494094, acc 0.765625\n",
      "2017-11-04T19:09:03.160999: step 924, loss 0.344555, acc 0.84375\n",
      "2017-11-04T19:09:03.520574: step 925, loss 0.280063, acc 0.921875\n",
      "2017-11-04T19:09:03.869237: step 926, loss 0.377915, acc 0.84375\n",
      "2017-11-04T19:09:04.246816: step 927, loss 0.436003, acc 0.8125\n",
      "2017-11-04T19:09:04.602539: step 928, loss 0.399311, acc 0.8125\n",
      "2017-11-04T19:09:05.052959: step 929, loss 0.255108, acc 0.921875\n",
      "2017-11-04T19:09:05.472927: step 930, loss 0.440498, acc 0.78125\n",
      "2017-11-04T19:09:05.791430: step 931, loss 0.503793, acc 0.78125\n",
      "2017-11-04T19:09:06.168281: step 932, loss 0.499693, acc 0.75\n",
      "2017-11-04T19:09:06.568362: step 933, loss 0.274693, acc 0.875\n",
      "2017-11-04T19:09:06.983210: step 934, loss 0.360331, acc 0.84375\n",
      "2017-11-04T19:09:07.408195: step 935, loss 0.388305, acc 0.84375\n",
      "2017-11-04T19:09:07.812926: step 936, loss 0.33303, acc 0.875\n",
      "2017-11-04T19:09:08.223235: step 937, loss 0.305924, acc 0.859375\n",
      "2017-11-04T19:09:08.512204: step 938, loss 0.366187, acc 0.828125\n",
      "2017-11-04T19:09:08.829337: step 939, loss 0.292701, acc 0.875\n",
      "2017-11-04T19:09:09.191818: step 940, loss 0.346249, acc 0.84375\n",
      "2017-11-04T19:09:09.468157: step 941, loss 0.384049, acc 0.8125\n",
      "2017-11-04T19:09:09.769770: step 942, loss 0.431129, acc 0.765625\n",
      "2017-11-04T19:09:10.030749: step 943, loss 0.427758, acc 0.8125\n",
      "2017-11-04T19:09:10.392992: step 944, loss 0.347134, acc 0.859375\n",
      "2017-11-04T19:09:10.749059: step 945, loss 0.473002, acc 0.796875\n",
      "2017-11-04T19:09:11.075097: step 946, loss 0.395628, acc 0.8125\n",
      "2017-11-04T19:09:11.370684: step 947, loss 0.281401, acc 0.875\n",
      "2017-11-04T19:09:11.665684: step 948, loss 0.333985, acc 0.859375\n",
      "2017-11-04T19:09:11.998653: step 949, loss 0.27802, acc 0.90625\n",
      "2017-11-04T19:09:12.306764: step 950, loss 0.357934, acc 0.84375\n",
      "2017-11-04T19:09:12.611132: step 951, loss 0.290538, acc 0.875\n",
      "2017-11-04T19:09:12.880131: step 952, loss 0.312083, acc 0.828125\n",
      "2017-11-04T19:09:13.234474: step 953, loss 0.393951, acc 0.84375\n",
      "2017-11-04T19:09:13.583763: step 954, loss 0.291982, acc 0.875\n",
      "2017-11-04T19:09:13.881072: step 955, loss 0.498202, acc 0.765625\n",
      "2017-11-04T19:09:14.235723: step 956, loss 0.456447, acc 0.78125\n",
      "2017-11-04T19:09:14.508955: step 957, loss 0.510342, acc 0.734375\n",
      "2017-11-04T19:09:14.837396: step 958, loss 0.253069, acc 0.90625\n",
      "2017-11-04T19:09:15.071024: step 959, loss 0.440902, acc 0.84375\n",
      "2017-11-04T19:09:15.464938: step 960, loss 0.398741, acc 0.859375\n",
      "2017-11-04T19:09:15.800094: step 961, loss 0.38641, acc 0.796875\n",
      "2017-11-04T19:09:16.054036: step 962, loss 0.332704, acc 0.859375\n",
      "2017-11-04T19:09:16.482278: step 963, loss 0.410142, acc 0.8125\n",
      "2017-11-04T19:09:16.800936: step 964, loss 0.420636, acc 0.796875\n",
      "2017-11-04T19:09:17.096696: step 965, loss 0.323398, acc 0.890625\n",
      "2017-11-04T19:09:17.441668: step 966, loss 0.340305, acc 0.875\n",
      "2017-11-04T19:09:17.721613: step 967, loss 0.459668, acc 0.796875\n",
      "2017-11-04T19:09:18.022100: step 968, loss 0.404183, acc 0.796875\n",
      "2017-11-04T19:09:18.368213: step 969, loss 0.409445, acc 0.796875\n",
      "2017-11-04T19:09:18.728082: step 970, loss 0.440836, acc 0.765625\n",
      "2017-11-04T19:09:19.042088: step 971, loss 0.425987, acc 0.8125\n",
      "2017-11-04T19:09:19.441867: step 972, loss 0.352236, acc 0.859375\n",
      "2017-11-04T19:09:19.775010: step 973, loss 0.30378, acc 0.859375\n",
      "2017-11-04T19:09:20.126958: step 974, loss 0.37727, acc 0.84375\n",
      "2017-11-04T19:09:20.399312: step 975, loss 0.269548, acc 0.859375\n",
      "2017-11-04T19:09:20.728897: step 976, loss 0.281117, acc 0.890625\n",
      "2017-11-04T19:09:21.050942: step 977, loss 0.339151, acc 0.9375\n",
      "2017-11-04T19:09:21.368477: step 978, loss 0.242125, acc 0.890625\n",
      "2017-11-04T19:09:21.781247: step 979, loss 0.443121, acc 0.859375\n",
      "2017-11-04T19:09:22.074202: step 980, loss 0.337319, acc 0.84375\n",
      "2017-11-04T19:09:22.364478: step 981, loss 0.354522, acc 0.859375\n",
      "2017-11-04T19:09:22.625961: step 982, loss 0.43631, acc 0.8125\n",
      "2017-11-04T19:09:22.957060: step 983, loss 0.416847, acc 0.78125\n",
      "2017-11-04T19:09:23.249971: step 984, loss 0.240055, acc 0.9375\n",
      "2017-11-04T19:09:23.610821: step 985, loss 0.373546, acc 0.84375\n",
      "2017-11-04T19:09:23.925897: step 986, loss 0.340913, acc 0.859375\n",
      "2017-11-04T19:09:24.253130: step 987, loss 0.370846, acc 0.84375\n",
      "2017-11-04T19:09:24.554503: step 988, loss 0.467252, acc 0.75\n",
      "2017-11-04T19:09:24.851470: step 989, loss 0.294827, acc 0.875\n",
      "2017-11-04T19:09:25.142691: step 990, loss 0.316368, acc 0.859375\n",
      "2017-11-04T19:09:25.392002: step 991, loss 0.384112, acc 0.8125\n",
      "2017-11-04T19:09:25.703491: step 992, loss 0.342495, acc 0.84375\n",
      "2017-11-04T19:09:26.042910: step 993, loss 0.318748, acc 0.890625\n",
      "2017-11-04T19:09:26.353705: step 994, loss 0.433152, acc 0.8125\n",
      "2017-11-04T19:09:26.599276: step 995, loss 0.346461, acc 0.828125\n",
      "2017-11-04T19:09:26.941057: step 996, loss 0.300089, acc 0.890625\n",
      "2017-11-04T19:09:27.311083: step 997, loss 0.290344, acc 0.890625\n",
      "2017-11-04T19:09:27.645835: step 998, loss 0.317579, acc 0.90625\n",
      "2017-11-04T19:09:27.952918: step 999, loss 0.44504, acc 0.828125\n",
      "2017-11-04T19:09:28.232924: step 1000, loss 0.427008, acc 0.8125\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:09:29.190897: step 1000, loss 0.578464, acc 0.681989\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-1000\n",
      "\n",
      "2017-11-04T19:09:29.633387: step 1001, loss 0.288672, acc 0.875\n",
      "2017-11-04T19:09:29.948764: step 1002, loss 0.35619, acc 0.84375\n",
      "2017-11-04T19:09:30.246931: step 1003, loss 0.359228, acc 0.796875\n",
      "2017-11-04T19:09:30.573380: step 1004, loss 0.486909, acc 0.75\n",
      "2017-11-04T19:09:30.852026: step 1005, loss 0.475327, acc 0.765625\n",
      "2017-11-04T19:09:31.124774: step 1006, loss 0.331547, acc 0.875\n",
      "2017-11-04T19:09:31.397962: step 1007, loss 0.392304, acc 0.8125\n",
      "2017-11-04T19:09:31.679258: step 1008, loss 0.525236, acc 0.734375\n",
      "2017-11-04T19:09:31.937903: step 1009, loss 0.410437, acc 0.8125\n",
      "2017-11-04T19:09:32.137610: step 1010, loss 0.426157, acc 0.828125\n",
      "2017-11-04T19:09:32.385068: step 1011, loss 0.397697, acc 0.859375\n",
      "2017-11-04T19:09:32.659585: step 1012, loss 0.335456, acc 0.84375\n",
      "2017-11-04T19:09:32.967574: step 1013, loss 0.322104, acc 0.875\n",
      "2017-11-04T19:09:33.260976: step 1014, loss 0.314906, acc 0.859375\n",
      "2017-11-04T19:09:33.562846: step 1015, loss 0.512611, acc 0.703125\n",
      "2017-11-04T19:09:33.896923: step 1016, loss 0.404517, acc 0.84375\n",
      "2017-11-04T19:09:34.188456: step 1017, loss 0.441592, acc 0.796875\n",
      "2017-11-04T19:09:34.472948: step 1018, loss 0.347204, acc 0.84375\n",
      "2017-11-04T19:09:34.738077: step 1019, loss 0.324731, acc 0.875\n",
      "2017-11-04T19:09:35.072308: step 1020, loss 0.49008, acc 0.8125\n",
      "2017-11-04T19:09:35.343369: step 1021, loss 0.359212, acc 0.859375\n",
      "2017-11-04T19:09:35.627513: step 1022, loss 0.407739, acc 0.796875\n",
      "2017-11-04T19:09:35.922267: step 1023, loss 0.373781, acc 0.828125\n",
      "2017-11-04T19:09:36.201966: step 1024, loss 0.320999, acc 0.90625\n",
      "2017-11-04T19:09:36.528427: step 1025, loss 0.426807, acc 0.859375\n",
      "2017-11-04T19:09:36.900237: step 1026, loss 0.36495, acc 0.859375\n",
      "2017-11-04T19:09:37.246066: step 1027, loss 0.291272, acc 0.890625\n",
      "2017-11-04T19:09:37.625494: step 1028, loss 0.425578, acc 0.828125\n",
      "2017-11-04T19:09:37.879396: step 1029, loss 0.373172, acc 0.828125\n",
      "2017-11-04T19:09:38.195436: step 1030, loss 0.456205, acc 0.8125\n",
      "2017-11-04T19:09:38.491994: step 1031, loss 0.414155, acc 0.84375\n",
      "2017-11-04T19:09:38.788688: step 1032, loss 0.359243, acc 0.8125\n",
      "2017-11-04T19:09:39.083038: step 1033, loss 0.332402, acc 0.890625\n",
      "2017-11-04T19:09:39.430434: step 1034, loss 0.383462, acc 0.8125\n",
      "2017-11-04T19:09:39.792940: step 1035, loss 0.555645, acc 0.75\n",
      "2017-11-04T19:09:40.126863: step 1036, loss 0.282833, acc 0.859375\n",
      "2017-11-04T19:09:40.532980: step 1037, loss 0.465005, acc 0.796875\n",
      "2017-11-04T19:09:40.906655: step 1038, loss 0.473971, acc 0.828125\n",
      "2017-11-04T19:09:41.313505: step 1039, loss 0.381616, acc 0.828125\n",
      "2017-11-04T19:09:41.710861: step 1040, loss 0.320137, acc 0.828125\n",
      "2017-11-04T19:09:42.092215: step 1041, loss 0.221737, acc 0.890625\n",
      "2017-11-04T19:09:42.499007: step 1042, loss 0.353534, acc 0.84375\n",
      "2017-11-04T19:09:42.855673: step 1043, loss 0.232768, acc 0.921875\n",
      "2017-11-04T19:09:43.167478: step 1044, loss 0.534719, acc 0.703125\n",
      "2017-11-04T19:09:43.536705: step 1045, loss 0.359541, acc 0.859375\n",
      "2017-11-04T19:09:43.831016: step 1046, loss 0.43397, acc 0.859375\n",
      "2017-11-04T19:09:44.122300: step 1047, loss 0.44722, acc 0.75\n",
      "2017-11-04T19:09:44.583082: step 1048, loss 0.347626, acc 0.84375\n",
      "2017-11-04T19:09:45.047787: step 1049, loss 0.290277, acc 0.875\n",
      "2017-11-04T19:09:45.382616: step 1050, loss 0.35925, acc 0.8\n",
      "2017-11-04T19:09:45.619257: step 1051, loss 0.395979, acc 0.84375\n",
      "2017-11-04T19:09:45.929565: step 1052, loss 0.190785, acc 0.921875\n",
      "2017-11-04T19:09:46.256198: step 1053, loss 0.271312, acc 0.90625\n",
      "2017-11-04T19:09:46.556035: step 1054, loss 0.259288, acc 0.90625\n",
      "2017-11-04T19:09:46.876966: step 1055, loss 0.284624, acc 0.90625\n",
      "2017-11-04T19:09:47.138704: step 1056, loss 0.290856, acc 0.875\n",
      "2017-11-04T19:09:47.508278: step 1057, loss 0.28588, acc 0.875\n",
      "2017-11-04T19:09:47.845925: step 1058, loss 0.421579, acc 0.8125\n",
      "2017-11-04T19:09:48.116360: step 1059, loss 0.412767, acc 0.828125\n",
      "2017-11-04T19:09:48.498228: step 1060, loss 0.360695, acc 0.796875\n",
      "2017-11-04T19:09:48.816808: step 1061, loss 0.343332, acc 0.828125\n",
      "2017-11-04T19:09:49.185153: step 1062, loss 0.385115, acc 0.828125\n",
      "2017-11-04T19:09:49.488281: step 1063, loss 0.379453, acc 0.8125\n",
      "2017-11-04T19:09:49.859356: step 1064, loss 0.350223, acc 0.875\n",
      "2017-11-04T19:09:50.224094: step 1065, loss 0.287452, acc 0.890625\n",
      "2017-11-04T19:09:50.488556: step 1066, loss 0.234175, acc 0.90625\n",
      "2017-11-04T19:09:50.846162: step 1067, loss 0.370156, acc 0.796875\n",
      "2017-11-04T19:09:51.159965: step 1068, loss 0.279615, acc 0.90625\n",
      "2017-11-04T19:09:51.550641: step 1069, loss 0.437773, acc 0.84375\n",
      "2017-11-04T19:09:51.888362: step 1070, loss 0.273618, acc 0.875\n",
      "2017-11-04T19:09:52.270834: step 1071, loss 0.339945, acc 0.921875\n",
      "2017-11-04T19:09:52.552012: step 1072, loss 0.305164, acc 0.890625\n",
      "2017-11-04T19:09:52.877432: step 1073, loss 0.346041, acc 0.828125\n",
      "2017-11-04T19:09:53.174060: step 1074, loss 0.332916, acc 0.875\n",
      "2017-11-04T19:09:53.461287: step 1075, loss 0.288266, acc 0.90625\n",
      "2017-11-04T19:09:53.754751: step 1076, loss 0.321723, acc 0.890625\n",
      "2017-11-04T19:09:54.080152: step 1077, loss 0.37065, acc 0.828125\n",
      "2017-11-04T19:09:54.491409: step 1078, loss 0.36901, acc 0.8125\n",
      "2017-11-04T19:09:54.759039: step 1079, loss 0.207461, acc 0.96875\n",
      "2017-11-04T19:09:55.138047: step 1080, loss 0.266544, acc 0.90625\n",
      "2017-11-04T19:09:55.501311: step 1081, loss 0.405116, acc 0.8125\n",
      "2017-11-04T19:09:55.785613: step 1082, loss 0.257958, acc 0.90625\n",
      "2017-11-04T19:09:56.098998: step 1083, loss 0.416839, acc 0.828125\n",
      "2017-11-04T19:09:56.351294: step 1084, loss 0.237861, acc 0.953125\n",
      "2017-11-04T19:09:56.700122: step 1085, loss 0.356823, acc 0.84375\n",
      "2017-11-04T19:09:56.945734: step 1086, loss 0.211181, acc 0.9375\n",
      "2017-11-04T19:09:57.291749: step 1087, loss 0.353023, acc 0.84375\n",
      "2017-11-04T19:09:57.616314: step 1088, loss 0.222791, acc 0.9375\n",
      "2017-11-04T19:09:57.961051: step 1089, loss 0.263063, acc 0.90625\n",
      "2017-11-04T19:09:58.329427: step 1090, loss 0.294563, acc 0.890625\n",
      "2017-11-04T19:09:58.612981: step 1091, loss 0.268952, acc 0.890625\n",
      "2017-11-04T19:09:59.029424: step 1092, loss 0.329543, acc 0.859375\n",
      "2017-11-04T19:09:59.390873: step 1093, loss 0.256555, acc 0.890625\n",
      "2017-11-04T19:09:59.730705: step 1094, loss 0.35282, acc 0.84375\n",
      "2017-11-04T19:10:00.016318: step 1095, loss 0.301723, acc 0.875\n",
      "2017-11-04T19:10:00.327063: step 1096, loss 0.350183, acc 0.859375\n",
      "2017-11-04T19:10:00.622408: step 1097, loss 0.294292, acc 0.875\n",
      "2017-11-04T19:10:00.888932: step 1098, loss 0.30734, acc 0.859375\n",
      "2017-11-04T19:10:01.241899: step 1099, loss 0.267953, acc 0.90625\n",
      "2017-11-04T19:10:01.502548: step 1100, loss 0.320487, acc 0.828125\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:10:02.407982: step 1100, loss 0.572656, acc 0.685741\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-1100\n",
      "\n",
      "2017-11-04T19:10:02.772656: step 1101, loss 0.310265, acc 0.875\n",
      "2017-11-04T19:10:03.051774: step 1102, loss 0.376403, acc 0.8125\n",
      "2017-11-04T19:10:03.445294: step 1103, loss 0.405109, acc 0.796875\n",
      "2017-11-04T19:10:03.764531: step 1104, loss 0.34798, acc 0.859375\n",
      "2017-11-04T19:10:04.073134: step 1105, loss 0.281587, acc 0.90625\n",
      "2017-11-04T19:10:04.356365: step 1106, loss 0.298636, acc 0.859375\n",
      "2017-11-04T19:10:04.718968: step 1107, loss 0.449684, acc 0.796875\n",
      "2017-11-04T19:10:05.102162: step 1108, loss 0.460583, acc 0.703125\n",
      "2017-11-04T19:10:05.376920: step 1109, loss 0.23936, acc 0.875\n",
      "2017-11-04T19:10:05.680299: step 1110, loss 0.354823, acc 0.875\n",
      "2017-11-04T19:10:05.947408: step 1111, loss 0.427053, acc 0.859375\n",
      "2017-11-04T19:10:06.331121: step 1112, loss 0.343094, acc 0.84375\n",
      "2017-11-04T19:10:06.674433: step 1113, loss 0.307541, acc 0.890625\n",
      "2017-11-04T19:10:07.059173: step 1114, loss 0.245213, acc 0.90625\n",
      "2017-11-04T19:10:07.338804: step 1115, loss 0.236883, acc 0.90625\n",
      "2017-11-04T19:10:07.627277: step 1116, loss 0.24937, acc 0.890625\n",
      "2017-11-04T19:10:07.896099: step 1117, loss 0.367091, acc 0.84375\n",
      "2017-11-04T19:10:08.333181: step 1118, loss 0.407735, acc 0.734375\n",
      "2017-11-04T19:10:08.584821: step 1119, loss 0.239827, acc 0.921875\n",
      "2017-11-04T19:10:08.889067: step 1120, loss 0.324944, acc 0.84375\n",
      "2017-11-04T19:10:09.249807: step 1121, loss 0.341736, acc 0.890625\n",
      "2017-11-04T19:10:09.634037: step 1122, loss 0.268288, acc 0.875\n",
      "2017-11-04T19:10:09.948922: step 1123, loss 0.316252, acc 0.890625\n",
      "2017-11-04T19:10:10.278745: step 1124, loss 0.313813, acc 0.90625\n",
      "2017-11-04T19:10:10.611872: step 1125, loss 0.330766, acc 0.84375\n",
      "2017-11-04T19:10:11.049683: step 1126, loss 0.4434, acc 0.75\n",
      "2017-11-04T19:10:11.387091: step 1127, loss 0.31329, acc 0.859375\n",
      "2017-11-04T19:10:11.736927: step 1128, loss 0.428475, acc 0.84375\n",
      "2017-11-04T19:10:12.103916: step 1129, loss 0.330021, acc 0.84375\n",
      "2017-11-04T19:10:12.484744: step 1130, loss 0.452795, acc 0.796875\n",
      "2017-11-04T19:10:12.846209: step 1131, loss 0.326248, acc 0.84375\n",
      "2017-11-04T19:10:13.180924: step 1132, loss 0.398317, acc 0.765625\n",
      "2017-11-04T19:10:13.472525: step 1133, loss 0.220937, acc 0.90625\n",
      "2017-11-04T19:10:13.871596: step 1134, loss 0.287289, acc 0.875\n",
      "2017-11-04T19:10:14.296669: step 1135, loss 0.237612, acc 0.921875\n",
      "2017-11-04T19:10:14.607788: step 1136, loss 0.331619, acc 0.859375\n",
      "2017-11-04T19:10:14.902568: step 1137, loss 0.313252, acc 0.890625\n",
      "2017-11-04T19:10:15.206803: step 1138, loss 0.242374, acc 0.90625\n",
      "2017-11-04T19:10:15.495170: step 1139, loss 0.320997, acc 0.859375\n",
      "2017-11-04T19:10:15.874297: step 1140, loss 0.288191, acc 0.859375\n",
      "2017-11-04T19:10:16.132627: step 1141, loss 0.431446, acc 0.78125\n",
      "2017-11-04T19:10:16.422107: step 1142, loss 0.40012, acc 0.796875\n",
      "2017-11-04T19:10:16.732843: step 1143, loss 0.287682, acc 0.859375\n",
      "2017-11-04T19:10:17.052246: step 1144, loss 0.341709, acc 0.84375\n",
      "2017-11-04T19:10:17.319675: step 1145, loss 0.247396, acc 0.890625\n",
      "2017-11-04T19:10:17.634391: step 1146, loss 0.316079, acc 0.8125\n",
      "2017-11-04T19:10:18.010325: step 1147, loss 0.296048, acc 0.875\n",
      "2017-11-04T19:10:18.337063: step 1148, loss 0.280293, acc 0.859375\n",
      "2017-11-04T19:10:18.726067: step 1149, loss 0.299806, acc 0.859375\n",
      "2017-11-04T19:10:19.034506: step 1150, loss 0.288136, acc 0.890625\n",
      "2017-11-04T19:10:19.430009: step 1151, loss 0.381871, acc 0.8125\n",
      "2017-11-04T19:10:19.687320: step 1152, loss 0.274626, acc 0.921875\n",
      "2017-11-04T19:10:19.929930: step 1153, loss 0.387413, acc 0.84375\n",
      "2017-11-04T19:10:20.221848: step 1154, loss 0.395494, acc 0.8125\n",
      "2017-11-04T19:10:20.516334: step 1155, loss 0.361312, acc 0.828125\n",
      "2017-11-04T19:10:20.873391: step 1156, loss 0.497672, acc 0.78125\n",
      "2017-11-04T19:10:21.203801: step 1157, loss 0.352802, acc 0.828125\n",
      "2017-11-04T19:10:21.639088: step 1158, loss 0.372189, acc 0.8125\n",
      "2017-11-04T19:10:21.952527: step 1159, loss 0.244827, acc 0.90625\n",
      "2017-11-04T19:10:22.282710: step 1160, loss 0.363009, acc 0.84375\n",
      "2017-11-04T19:10:22.576147: step 1161, loss 0.30399, acc 0.859375\n",
      "2017-11-04T19:10:22.961993: step 1162, loss 0.418711, acc 0.859375\n",
      "2017-11-04T19:10:23.252973: step 1163, loss 0.252798, acc 0.90625\n",
      "2017-11-04T19:10:23.652745: step 1164, loss 0.319627, acc 0.875\n",
      "2017-11-04T19:10:23.921846: step 1165, loss 0.269617, acc 0.90625\n",
      "2017-11-04T19:10:24.270954: step 1166, loss 0.236303, acc 0.90625\n",
      "2017-11-04T19:10:24.584704: step 1167, loss 0.329913, acc 0.84375\n",
      "2017-11-04T19:10:24.986805: step 1168, loss 0.229061, acc 0.9375\n",
      "2017-11-04T19:10:25.352318: step 1169, loss 0.369721, acc 0.875\n",
      "2017-11-04T19:10:25.616173: step 1170, loss 0.204594, acc 0.890625\n",
      "2017-11-04T19:10:25.905572: step 1171, loss 0.386082, acc 0.828125\n",
      "2017-11-04T19:10:26.251175: step 1172, loss 0.371908, acc 0.875\n",
      "2017-11-04T19:10:26.553755: step 1173, loss 0.406906, acc 0.796875\n",
      "2017-11-04T19:10:26.940920: step 1174, loss 0.252001, acc 0.890625\n",
      "2017-11-04T19:10:27.282983: step 1175, loss 0.390999, acc 0.796875\n",
      "2017-11-04T19:10:27.674510: step 1176, loss 0.275222, acc 0.890625\n",
      "2017-11-04T19:10:27.987626: step 1177, loss 0.241677, acc 0.921875\n",
      "2017-11-04T19:10:28.372553: step 1178, loss 0.37661, acc 0.8125\n",
      "2017-11-04T19:10:28.711300: step 1179, loss 0.36232, acc 0.828125\n",
      "2017-11-04T19:10:29.013222: step 1180, loss 0.200554, acc 0.90625\n",
      "2017-11-04T19:10:29.350857: step 1181, loss 0.388711, acc 0.796875\n",
      "2017-11-04T19:10:29.625511: step 1182, loss 0.397074, acc 0.765625\n",
      "2017-11-04T19:10:29.947196: step 1183, loss 0.27508, acc 0.890625\n",
      "2017-11-04T19:10:30.236734: step 1184, loss 0.311601, acc 0.890625\n",
      "2017-11-04T19:10:30.543550: step 1185, loss 0.413354, acc 0.828125\n",
      "2017-11-04T19:10:30.863975: step 1186, loss 0.351706, acc 0.828125\n",
      "2017-11-04T19:10:31.143499: step 1187, loss 0.280607, acc 0.890625\n",
      "2017-11-04T19:10:31.496473: step 1188, loss 0.27894, acc 0.828125\n",
      "2017-11-04T19:10:31.764133: step 1189, loss 0.306372, acc 0.828125\n",
      "2017-11-04T19:10:32.055110: step 1190, loss 0.269497, acc 0.875\n",
      "2017-11-04T19:10:32.437024: step 1191, loss 0.240039, acc 0.890625\n",
      "2017-11-04T19:10:32.810461: step 1192, loss 0.341722, acc 0.859375\n",
      "2017-11-04T19:10:33.126941: step 1193, loss 0.339723, acc 0.828125\n",
      "2017-11-04T19:10:33.435422: step 1194, loss 0.531422, acc 0.765625\n",
      "2017-11-04T19:10:33.791827: step 1195, loss 0.360857, acc 0.875\n",
      "2017-11-04T19:10:34.037911: step 1196, loss 0.455116, acc 0.765625\n",
      "2017-11-04T19:10:34.391371: step 1197, loss 0.262808, acc 0.890625\n",
      "2017-11-04T19:10:34.685192: step 1198, loss 0.379271, acc 0.84375\n",
      "2017-11-04T19:10:35.077418: step 1199, loss 0.307252, acc 0.84375\n",
      "2017-11-04T19:10:35.379237: step 1200, loss 0.415442, acc 0.833333\n",
      "\n",
      "Evaluation:\n",
      "2017-11-04T19:10:36.345234: step 1200, loss 0.554985, acc 0.70075\n",
      "\n",
      "Saved model checkpoint to /home/ellfae/Dropbox/WORK/PhD Research/elvis_emotion_2017/runs/1509793447/checkpoints/model-1200\n",
      "\n",
      "2017-11-04T19:10:36.825007: step 1201, loss 0.239565, acc 0.953125\n",
      "2017-11-04T19:10:37.050460: step 1202, loss 0.321609, acc 0.90625\n",
      "2017-11-04T19:10:37.355165: step 1203, loss 0.27607, acc 0.90625\n",
      "2017-11-04T19:10:37.653353: step 1204, loss 0.196959, acc 0.90625\n",
      "2017-11-04T19:10:37.970007: step 1205, loss 0.21933, acc 0.921875\n",
      "2017-11-04T19:10:38.247233: step 1206, loss 0.263651, acc 0.921875\n",
      "2017-11-04T19:10:38.540099: step 1207, loss 0.291896, acc 0.875\n",
      "2017-11-04T19:10:38.844295: step 1208, loss 0.232832, acc 0.953125\n",
      "2017-11-04T19:10:39.129198: step 1209, loss 0.155255, acc 0.953125\n",
      "2017-11-04T19:10:39.418463: step 1210, loss 0.260173, acc 0.890625\n",
      "2017-11-04T19:10:39.701190: step 1211, loss 0.245824, acc 0.890625\n",
      "2017-11-04T19:10:39.994585: step 1212, loss 0.306754, acc 0.875\n",
      "2017-11-04T19:10:40.307344: step 1213, loss 0.266003, acc 0.875\n",
      "2017-11-04T19:10:40.694641: step 1214, loss 0.29173, acc 0.921875\n",
      "2017-11-04T19:10:40.968923: step 1215, loss 0.318894, acc 0.84375\n",
      "2017-11-04T19:10:41.402981: step 1216, loss 0.305391, acc 0.859375\n"
     ]
    }
   ],
   "source": [
    "with tf.Graph().as_default():\n",
    "    session_conf = tf.ConfigProto(\n",
    "      allow_soft_placement=FLAGS.allow_soft_placement,\n",
    "      log_device_placement=FLAGS.log_device_placement)\n",
    "    sess = tf.Session(config=session_conf)\n",
    "    with sess.as_default():\n",
    "        cnn = cnn_model_helpers.TextCNN(\n",
    "            sequence_length=x_train.shape[1],\n",
    "            num_classes=y_train.shape[1],\n",
    "            vocab_size=len(vocab_processor.vocabulary_),\n",
    "            embedding_size=FLAGS.embedding_dim,\n",
    "            filter_sizes=list(map(int, FLAGS.filter_sizes.split(\",\"))),\n",
    "            num_filters=FLAGS.num_filters,\n",
    "            l2_reg_lambda=FLAGS.l2_reg_lambda)\n",
    "\n",
    "        # Define Training procedure\n",
    "        global_step = tf.Variable(0, name=\"global_step\", trainable=False)\n",
    "        optimizer = tf.train.AdamOptimizer(1e-3)\n",
    "        grads_and_vars = optimizer.compute_gradients(cnn.loss)\n",
    "        train_op = optimizer.apply_gradients(grads_and_vars, global_step=global_step)\n",
    "\n",
    "        # Keep track of gradient values and sparsity (optional)\n",
    "        grad_summaries = []\n",
    "        for g, v in grads_and_vars:\n",
    "            if g is not None:\n",
    "                grad_hist_summary = tf.summary.histogram(\"{}/grad/hist\".format(v.name), g)\n",
    "                sparsity_summary = tf.summary.scalar(\"{}/grad/sparsity\".format(v.name), tf.nn.zero_fraction(g))\n",
    "                grad_summaries.append(grad_hist_summary)\n",
    "                grad_summaries.append(sparsity_summary)\n",
    "        grad_summaries_merged = tf.summary.merge(grad_summaries)\n",
    "\n",
    "        # Output directory for models and summaries\n",
    "        timestamp = str(int(time.time()))\n",
    "        out_dir = os.path.abspath(os.path.join(os.path.curdir, \"runs\", timestamp))\n",
    "        print(\"Writing to {}\\n\".format(out_dir))\n",
    "\n",
    "        # Summaries for loss and accuracy\n",
    "        loss_summary = tf.summary.scalar(\"loss\", cnn.loss)\n",
    "        acc_summary = tf.summary.scalar(\"accuracy\", cnn.accuracy)\n",
    "\n",
    "        # Train Summaries\n",
    "        train_summary_op = tf.summary.merge([loss_summary, acc_summary, grad_summaries_merged])\n",
    "        train_summary_dir = os.path.join(out_dir, \"summaries\", \"train\")\n",
    "        train_summary_writer = tf.summary.FileWriter(train_summary_dir, sess.graph)\n",
    "\n",
    "        # Dev summaries\n",
    "        dev_summary_op = tf.summary.merge([loss_summary, acc_summary])\n",
    "        dev_summary_dir = os.path.join(out_dir, \"summaries\", \"dev\")\n",
    "        dev_summary_writer = tf.summary.FileWriter(dev_summary_dir, sess.graph)\n",
    "\n",
    "        # Checkpoint directory. Tensorflow assumes this directory already exists so we need to create it\n",
    "        checkpoint_dir = os.path.abspath(os.path.join(out_dir, \"checkpoints\"))\n",
    "        checkpoint_prefix = os.path.join(checkpoint_dir, \"model\")\n",
    "        if not os.path.exists(checkpoint_dir):\n",
    "            os.makedirs(checkpoint_dir)\n",
    "        saver = tf.train.Saver(tf.global_variables(), max_to_keep=FLAGS.num_checkpoints)\n",
    "\n",
    "        # Write vocabulary\n",
    "        vocab_processor.save(os.path.join(out_dir, \"vocab\"))\n",
    "\n",
    "        # Initialize all variables\n",
    "        sess.run(tf.global_variables_initializer())\n",
    "\n",
    "        def train_step(x_batch, y_batch):\n",
    "            \"\"\"\n",
    "            A single training step\n",
    "            \"\"\"\n",
    "            feed_dict = {\n",
    "              cnn.input_x: x_batch,\n",
    "              cnn.input_y: y_batch,\n",
    "              cnn.dropout_keep_prob: FLAGS.dropout_keep_prob\n",
    "            }\n",
    "            _, step, summaries, loss, accuracy = sess.run(\n",
    "                [train_op, global_step, train_summary_op, cnn.loss, cnn.accuracy],\n",
    "                feed_dict)\n",
    "            time_str = datetime.datetime.now().isoformat()\n",
    "            print(\"{}: step {}, loss {:g}, acc {:g}\".format(time_str, step, loss, accuracy))\n",
    "            train_summary_writer.add_summary(summaries, step)\n",
    "\n",
    "        def dev_step(x_batch, y_batch, writer=None):\n",
    "            \"\"\"\n",
    "            Evaluates model on a dev set\n",
    "            \"\"\"\n",
    "            feed_dict = {\n",
    "              cnn.input_x: x_batch,\n",
    "              cnn.input_y: y_batch,\n",
    "              cnn.dropout_keep_prob: 1.0\n",
    "            }\n",
    "            step, summaries, loss, accuracy = sess.run(\n",
    "                [global_step, dev_summary_op, cnn.loss, cnn.accuracy],\n",
    "                feed_dict)\n",
    "            time_str = datetime.datetime.now().isoformat()\n",
    "            print(\"{}: step {}, loss {:g}, acc {:g}\".format(time_str, step, loss, accuracy))\n",
    "            if writer:\n",
    "                writer.add_summary(summaries, step)\n",
    "\n",
    "        # Generate batches\n",
    "        batches = cnn_data_helpers.batch_iter(\n",
    "            list(zip(x_train, y_train)), FLAGS.batch_size, FLAGS.num_epochs)\n",
    "        \n",
    "        # Training loop. For each batch...\n",
    "        for batch in batches:\n",
    "            x_batch, y_batch = zip(*batch)\n",
    "            train_step(x_batch, y_batch)\n",
    "            current_step = tf.train.global_step(sess, global_step)\n",
    "            if current_step % FLAGS.evaluate_every == 0:\n",
    "                print(\"\\nEvaluation:\")\n",
    "                dev_step(x_dev, y_dev, writer=dev_summary_writer)\n",
    "                print(\"\")\n",
    "            if current_step % FLAGS.checkpoint_every == 0:\n",
    "                path = saver.save(sess, checkpoint_prefix, global_step=current_step)\n",
    "                print(\"Saved model checkpoint to {}\\n\".format(path))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# to run the tensorboard to visualize the summaries of the graph\n",
    "#tensorboard --logdir /home/ellfae/Dropbox/WORK/PhD_Research/coding/runs/1497426429/summaries/"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "cnn.W"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
